« first day (878 days earlier)      last day (4052 days later) » 

3:01 AM
why?
 
It's always fun to dig through old questions on SO and see all the accepted outright wrong answers.
Even funnier when 90k+ users are involved.
Well, I'm off to bed. You guys stay hardcore.
 
Hardddcoooooooooooore.
But, uh.
Turns out the compiler is pretty retarded when it comes to generating operator= and T() constructors for move'd (T&&) types.
Maybe I need to std::forward instead?
@DomagojPandža Sleep tiiight.
 
I've been contemplating the viability of a "serverless" MMO. Peers connect and play and validate each other's actions to detect cheaters. Games log IPs of peers of friends, guildies, and people that are on frequently so they can easily "reattach". Maybe occasionally they also join/post in an IRC chat so others can find the server the first time. "torrent sharing" patches is viable, but how to confirm that only I can produce said patches and the whole thing doesn't become hijacked?
 
@MooingDuck You can't. It becomes like Minecraft at that point.
 
@ThePhD I'm not writing in Java, nor publishing any sort of API
 
3:13 AM
That just makes the cracking harder, but still not uncrackeable.
 
@ThePhD I think I missed too much of what you're doing to answer that
 
The point is, you're handing out a GameServer.exe and handing it out to the player, with maybe some configuration tools.
 
@ThePhD well obviously. Nothing is uncrackable. But it ought to at least be hard. I can't figure out how to make it hard even.
 
@ThePhD when you have a move constructor, copy constructors are implicitly deleted
 
What can I put in a client as a way to validate a future patch?
 
3:14 AM
signed public/private keys?
That's the best guarantee you can afford.
 
@ThePhD most downloaders would have no direct connection to the source. I don't know much about private/public keys, but I'm not sure that can apply here.
 
Well, you'll probably need to put some kind of strong key or encryption inside of your program. When it receives a patch, it'll have to validate against that.
That's your best offline method.
Encryption being like a CD Key, except only for your patches.
 
Make a magnet uri of the patches :D
 
@ThePhD no, I don't need the patch to validate the client, I need the client to validate the patch.
 
@MooingDuck That's what I mean!
 
3:18 AM
@Rapptz requires stable server, the point of this exercise is to "host" a MMO on a server that only rarely is actually online.
 
Like, the client accepts the Patch's 'Key' if and only if it's valid.
 
@ThePhD but that becomes trivial to bruteforce.
 
@MooingDuck Hosting magnet links shouldn't take much of a server really
At least I don't imagine so
 
@Rapptz magnet links to what?
 
Your patches
You said it was P2P right?
 
3:19 AM
@Rapptz yeah
I should read what a magnet link is
 
The Magnet URI scheme is a de facto standard (instead of an open standard) defining a URI scheme for Magnet links, which mainly refer to resources available for download via peer-to-peer networks. Such a link typically identifies a file not by location, but by content—more precisely, by the content's cryptographic hash value. Since it specifies a file based on content or metadata, rather than by location, a Magnet link can be considered a kind of Uniform Resource Name, rather than the more common Uniform Resource Locators. Although it could be used for other applications, it is particul...
 
Your last thing to do then is to package your clients with a decrypter for your Patch data. If the data does not meet your extremely rigorous checks and other things, then reject the patch.
 
@Rapptz that looks remarkably like what I need
@ThePhD I figured an encrypted signal was a given. I wasn't concerned about that part.
@Rapptz yeah, really all I need is an "official md5sum" which is always available from an official source, and they can validate against that. That's an awesome idea
 
Isn't md5 weak in some way though?
 
If someone has a database for it
 
3:23 AM
@MooingDuck So then the only thing you'd need is an always-up server that does validation of patches.
Which honestly is about as simple as a ping application.
 
@ThePhD yeah, I'm still thinking about a way to work around that
 
o.o
You can't have it both ways.
Either you have an always-up server that can continuously verify patches,
 
so far I've solved all problems with very light usage of a "borrowed" IRC server :P
 
or you run the risk of having your offline encryptions broken.
 
What if a patch is released daily, and each patch contains the md5sum of the subsequent patch? Even if the patches are "no changes", that provides a way to validate official patches. Hackers would have to inject a patch with the same md5sum, but when clients notice there's two different patches, they can "poll", and drop the less popular one. Assumes official patches will be far more common.
 
3:29 AM
@ThePhD Yes -- it's open to a relatively low-effort collision attack (i.e., you can create two inputs that produce the same MD5 hash, in under an hour on pretty much any desktop newer than a Pentium III (or thereabouts).
 
wait, I don't think that works, because then (A) I'd have to know the md5sum of every subsequent patch, or (B) hacker could simply replace that md5sum the day before :(
 
Yeah...
So: Always on-line server verifying patches. :D
 
You could use SHA-2
 
BitTorrent uses SHA-1 I think.
But SHA-2 is supposed to be... .. better?
 
@Rapptz the flaw applies to the concept, not the particular hashing method
 
3:31 AM
@JerryCoffin Ooh. Nice~
 
Oh but still.
Nothing wrong with better hashing
 
So.
I need to replace a resource in my Cache.
It's stored as a plain (T).
 
Unless I use the IRC server to validate the patch? Patches are posted by a particular user that is validated by the IRC server?
 
games I play have a naming scheme for patches that goes
000XXto000YY
where XX is the previous version and YY is the current
 
@Rapptz Yes, if you're designing something new today, SHA-2 is the clear choice. There is also a collision attack against SHA-1, but it's much more difficult (years with a high-end machine instead of an hour with something you got for free. Still, there is a known weakness, and over time, better attacks may well be found.
 
3:34 AM
@MooingDuck Patches are posted somewhere. One person gets them, then sends them out. Then it tree-folds its way out into the world. Every person, when applying the patch, phones home to your server. In case phoning home fails, {crash or just let them play at the lower-level patch}. If it succeeds, verifying the cryptographic hash of the patch's data.
If the verification succeeds, apply the patch.
If it does not succeed, it's not legitimate.
If you don't want to phone-home, then you need to build the verification into the application (how?)
 
@ThePhD one of the goals of the exercise was for me to not actually have a server
 
Then you have to have verification built into the application.
 
basically, I was only using the IRC server so that new players could join. Otherwise, even that was optional
 
@ThePhD There are better ways than this, that don't require an always-online presence. Instead of just a SHA-2 hash, you use PK crypto to sign the hash. This lets anybody verify the hash with your public key, but to sign, they need your private key.
 
@JerryCoffin oh, wait, duh
 
3:39 AM
@JerryCoffin I suggested that earlier!!!
25 mins ago, by ThePhD
signed public/private keys?
25 mins ago, by ThePhD
That's the best guarantee you can afford.
 
@ThePhD Must have been before I got back. Good suggestion though.
 
@ThePhD No, not a signed key. You hash, then use a private key to sign the hash.
 
He could build his public key into the Client.
 
@ThePhD yeah, that's what I was thinking
 
3:42 AM
That way, cracking would be a matter of cracking his application's built-in public key.
 
@ThePhD no, that's the public key. The goal is to give that one away.
 
I don't know if that video is nsfw but it's graphic
 
I meant manipulating the public key to decrypting the hash into something the hacker would want for their file.
But that's a level of hardcoreness that's nigh impossible, I think.
Bah.
 
@ThePhD There known attacks on nearly all forms of PK crypto (most of which work equally well for signatures or encryption), but they're well enough known that short of a major breakthrough, preventing them is purely a matter of choosing a suitable key size.
 
1 KB key!
.. Or is that too small? :c
Maybe 32 KB key.
 
3:48 AM
I really want that Minesweeper Adventure game on Windows 7
 
Alsooo
Guuise, I think the compiler's really stupid when it comes to dealing with my class. =[
 
Yes yes, blame the tools not yourself.
 
No, seriously!
Like, look:
*(resourceholder->resource) = std::move( *value );
with T* value and T* resource (on resourceholder).
 
@ThePhD RSA needs about the biggest keys of anything, and for it about 2048 bits is about as big as there's any reason to use. For elliptical curve cryptography, key sizes are on the same order as for private key encryption (a couple hundred bits or so is plenty).
 
@JerryCoffin So 2 KBits then?
For MAXIMUM security?
MAXIIIMUUUUUM
 
3:52 AM
@ThePhD If you want to be insane about it, feel free to use 4096 bits instead -- you certainly won't be the only person who's done so.
 
@Rapptz The error that occurs is: This diagnostic occurred in the compiler generated function 'Furrovine::Graphics::Texture2D &Furrovine::Graphics::Texture2D::operator =(const Furrovine::Graphics::Texture2D &)
It's trrying to do a copy ctor
When I have a unique_ptr on my class!
 
When I have a move constructor, the copy constructors are deleted
 
I'm even std::move-ing and it it's still trying to do copy assignment / copy construction
@Rapptz I have neither declared on my class, I thought the compiler would just generate a move constructor for me.
 
Don't think so.
 
Well.
This...
... is going to suck.
I have to write move constructors for like 30 classes now. ;~;
 
3:56 AM
In function 'int main()':
15:12: error: use of deleted function 'Test<int>& Test<int>::operator=(const Test<int>&)'
5:7: note: 'Test<int>& Test<int>::operator=(const Test<int>&)' is implicitly declared as deleted because 'Test<int>' declares a move constructor or move assignment operator
 
And that's when you std::move ?
 
no that's when I use operator=
 
try leftTest = std::move( rightTest );
 
same error
 
Tits. =[
 
4:01 AM
I love that feeling of closing 30+ tabs.
 
o_O
Really?
 
@ThePhD MSVC?
 
@MooingDuck Yeah.
 
@ThePhD Yes
 
@ThePhD MSVC doesn't do rule of zero. Add explicit move/copy constructors to Test.
I have a bug report on it somewhere
 
4:02 AM
So I have to write a bunch of MOV constructors? :c
 
@ThePhD and copy :(
 
yes
 
I quit. =[
 
Buahaha
Closed.
"As deferred", they say.
Meaning, "never in a million fucking years."
I know STL is working hard, but really.
Hire some more people on that team.
There are like teams fo 8, 9, and 10 in VS TeamFoundation and other areas.
Allocate some goddamn resources for the underlying shit that matters.
 
4:05 AM
srsly
 
I guess STL wasn't kidding on his reddit posts asking for people of his skill level to contact him about a job.
 
@Rapptz this case is the tool :D
 
They're really hurting for good C++ developers. The rest are probably already all snatched up by G++ and it's opensource allure. =[
 
52 mins ago, by Mooing Duck
@ThePhD I think I missed too much of what you're doing to answer that
 
@MooingDuck I forgot he was using MSVC.
 
4:06 AM
but as soon as you showed me the one line of code, I immediately knew the bug :D
 
<3 MooingDuck.
To this day, MooingDuck has probably been the most helpful lounge person I've come across.
On my first days here, he showed me the power of templates, and the orgasmic wankery thereafter. After that, he continued to help me with all kinds fo stuff.
If I could give you a medal, I would. <3
 
@ThePhD that earned you a place on my profile!
 
@MooingDuck Your compiler-fu is growing!
 
compiler-fu too strong
 
I feel like sehe!
 
4:09 AM
A place on your profile? o_O
 
He has a bunch of compliments there
 
to stroke my own ego
 
Basically.
 
@Rapptz I have to remove them little by little as I add code though :(
 
Lol. I've joined the legions of MooingDuck's followers.
 
4:11 AM
I don't know anyone who's helped me that much here :(
I don't ask for much help
I'm afraid of asking if anything
 
@Xeo WHY ARE YOU AWAKE GO TO BED. D:<
 
@Rapptz "0 Questions This user has not asked any questions"
 
That's intentional.
 
He's pulling a CatPlusPlus.
 
@Rapptz got a seperate acct for asking questions? :D
 
4:12 AM
nope, never asked one.
I was thinking about asking one about making uint8_t prettier for printing but that is a dupe
-1
Q: C++: Questions about using namespace std and cout

Justin LiangWhy do I need to type in using namespace std; in order to be able to use cout and endl? Also what are these called; is cout a function? Is there cout in C? I heard it was implemented in C++ because it is better in many ways.

See why using namespace std; is bad for you @ThePhD?
 
Nope.
Long live using namespace !
 
=[
Well
... It still has its uses!
 
I right clicked a pdf, clicked print, and it printed out 3 pages of gibberish. It appears to be correctly formatted but... it's complete gibberish.
if I open the file with adobe pdf viewer, and print from there it prints fine
 
Maybe you should fax it
0
Q: Declaring and accessing an enum in a singleton class- C++

NeonGlowC++ Beginner Question! If there is an enum in the public section of a singleton class, what is the correct way to use the enum values from outside the singleton class. class MySingletonClass { public: static MySingletonClass & Singleton(); enum { eCodeZero ...

 
4:24 AM
Arrggghh
I can't believe I have to generate mov constructors from the bottom up
This is SO frustrating.
When I get to Microsoft I'm raiding the compiler code and adding shit myself. ._.
 
@ThePhD only the classes that you want to move
 
All of my resource-based classes!
 
@ThePhD probably all of your classes
@ThePhD my wife is asking if you're a student or have a phd or what?
 
Texture1D/2D/3D/Cube, ShaderResource, GraphicsResource.
I'm just a regular student.
God forbid I went to CS PhD level, where everyone's wanking about theory and nobody's making shit. ._.
 
my uncle has a PhD in CS but I know more about programming than him
 
4:30 AM
Yeah...
 
-10
Q: Can you suggest a perfect name for my new programing site?

TharinduluckyI'm starting a new programing teaching site. PHP, MySQL, and Even HTML and CSS. They're my subjects. I have no idea about a good name for my site. Could you guys please help me to find a perfect name for me ? These are the points I'd like to think about. It can/should be a word related to prog...

lol ^
 
nice
 
way to nuke your question with those tags.
 
> deleted by icktoofay, bfavaretto, Michael Petrotta 32 secs ago
 
Just in time :P
 
4:31 AM
Lol
SO doens't take kindly to competition. :P
.... OH MY GOD I HAVE TO WRITE ASSIGNMENT OPERATORS TOO, IT WON'T JUST INVOKE THE MOVE CONSTRUCTOR?!
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFf
Ragequit.
 
Is your Resource class basically Boost::Any?
 
No.
 
an std::unordered_map of boost::any?
 
Noooooo.
 
Ah. Okay.
 
4:33 AM
GraphicsResource contains a reference to the GraphicsDevice it was created with.
This allows classes to do things by itself without having to ask for a GraphicsDevice all the time.
 
a reference or a pointer?
 
Pointer.
 
I do that too but it makes me feel bad.
 
ShaderResource stores a ID3D11ShaderResourceView in a unique_ptr
 
feels like I'm doing something wrong
 
4:34 AM
@Rapptz References are lame, because they can't be nullified.
 
I meant keeping a pointer to another class
 
Could use std::reference_wrapper too, I guess
@Rapptz GraphicsDevice::Destruct <--- event that any class and hook into to see if the pointer dies.
 
o_O Whoa.
 
@ThePhD Seems like a better idea truthfully
 
4:37 AM
Meh.
It's extra wrapping for what is essentially just a pointer.
Might as well just use the pointers.
 
without the trouble of pointers
 
?
You mean -> ? and dereferencing with * ?
 
segmentation faults and other things if you're not too careful
 
That's if you give it null.
If you're that paranoid, just null-check.
 
don't you remember how I had an error and it was because I forgot to null check
can happen to anyone \o/
 
4:39 AM
reference_wrapper wouldn't have saved you
It would've segfaulted all the same
 
prolly
 
ANd you'd probably suspect it less, because the syntax would lie to you
 
yeah, I rarely null check. If there's an error, the OS will tell me automatically
 
I have all my null checks in debug mode
 
I nullcheck all the time. :|
 
4:41 AM
@ThePhD so long as it's not release
 
In release mode, there's less checks, but only in critical sections.
Where null would do some really nasty things.
 
Well isn't that the only time you would null check?
o.o
I only null check if I'm doing something with the pointer that would more than likely crash if it was null
 
Oh my god I'm going to scream...
All of this stupid stuff that C++ should just do by default, that it just doesn't do.
 
@ThePhD Then use Java.
 
It's not about Java.
 
4:50 AM
Can I download qmake separately? :(
 
@ThePhD Then PHP?
 
It's about things like copy constructors, move constructors, and move assignments / copy assignments that the compiler should be able to generate correctly, if it's going to do it automatically.
 
@ThePhD Java doesn't have those problems. So use Java. :P
 
That's an MSVC issue
 
The compiler right now is generating a bunch of retarded function calls I did not ask for, and then is erroring when ti generators these calls because its blistering retarded.
Whhyyhyhyhhyhthyhewrherwrhewjrhwjrwehjwer
I quit. ;~;
 
user1357851
4:54 AM
Winners never quit and quitters never win, those who never win and never quit can be found in Lounge<C++>
 
@DeadMG @Xeo Here's my best version of the ResourceCache, which does not demand that resources are assignable by move until you use Replace. It is based exclusively on pointers because that provides the most flexibility for initialization. Perhaps later, I will write an overload for Add/Replace to take a moved or a copied value.
 
user1357851
@MostafaShahverdy Hey & if you intend to ask a C++ question, none of our helpdesk stuff is present
 
Ok, will get back later ;)
 
In the end, I decided to avoid using T** in my code for hotswappability and instead depended on resource values being moved and deallocated. The obvious problem is that old resources will be deleted: the benefit is that it's clean and tidy and doesn't require any T** magic and instead all that is necessary is regular T* pointers for resource indirection.
This just means I'll have to be sure that if I want to swap out all values related to a specific resource, I'll have to update all the pointers manually to point to something new. But that's a battle I can fight later.
With the new system, I can also use my FileSystemWatcher to re-load items on-demand while I am debugging the game. This might be especially useful for shaders, but I'm going to have to write some 30 x 2 move operator=/constructurs for it to work, which is a massive sink in coding time.
 
5:03 AM
lol I edited his question and then closed it.
9
Q: How can I prove Google Chrome Web Store that I'm a developer and not a spammer in order to be able to publish my extenssions?

Mostafa ShahverdyI have some Google Chrome extensions I want to publish, but when I log into my Chrome Webstore account it says: Before you publish your first item, you must pay a one-time US$5.00 developer registration fee. We charge this fee in order to verify developer accounts and better protect users...

 
Gotta get dem edit points.
 
You don't get rep from editing past 2k
 
lol
 
Oh.
Well then you're just an edit junkie.
TIME FOR MORE MOVE CONSTRUCTOR ERRORS
OH BOOOOOY
 
It's pure incentive.
 
5:11 AM
The problem is that people won't have that badge are too inexperienced anyway to care.
 
Vector3 GetPosition(); and void SetPosition(Vector3); or! Should I do: Vector3 Position() and void Position (Vector3); ?
 
getposition should be const
also former
 
Bleh.
Fine.
 
@ThePhD Also an alternative would be to just make it public
Unless that's against your religion
TIL qmake is a standalone exe
 
I'm not religious at all, actually.
Most of my stuff is non-private to being with.
In this case, other variables are set and other work is done.
If that wasn't the case, I'd just smack around some public shit.
 
5:24 AM
Rule of thumb is to use getters and setters when other things are going on besides setting/getting
yeah like that
I do it when my variable names are pretty ugly but the function names make more sense
(this is mostly related to length)
:( why
 
user1357851
malware
 
lol
tons of small files?
 
@Mysticial yeah..
 
hehe
 
1949 files.
MinGW is worse.
Hm.. Is there a way to fix that?
 
5:35 AM
^^ which has me wondering...
That's the source code for y-cruncher.
And it's pretty efficient space-wise...
 
Is it in an external or internal?
 
???
 
the source
external or internal hard drive
 
internal
 
Ah.
 
5:36 AM
Not that it matters. The allocation size is 4kB on both my internal and externals.
 
I think mine's big because it's on my external.. which is why I want to fix it.
 
user1357851
size on disk is always slightly larger than size
 
Yeah slightly.. not ~2x the size.
 
user1357851
it is only when it is 200+% larger you should be worried
 
MinGW on my internal ^
Oh I found out why
whee.
 
5:45 AM
lol?
 
@Mysticial I'm using FAT instead of FAT32 or NTFS
Stupid isn't it
 
FAT has a large allocation size?
 
Yeah seems like it.
 
Create a small text file and see how much it uses.
 
It's only an issue when dealing with multiple small files apparently.
I'm not sure what the cluster size is for FAT since it doesn't specify 12/16/32
@Mysticial lol
 
5:54 AM
wtf
 
ahahaha
 
WTF
> I wonder what type of gun the producer was pointing at Scott while they were filming this...
 
this video is hilarious
ahaha the cure cancer recommended video
 
@Mysticial FAT16 only supports 65536 (minus a few) clusters per disk, so if the disk is very big, those clusters get pretty big in a hurry. For example, to address all of even a 4 GB disk as a single partition, you need 4GB/65536 = 64K clusters.
 
@JerryCoffin oh... that's fail. lol
 

« first day (878 days earlier)      last day (4052 days later) »