Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 04 Feb 2008
Online Last Active Today, 05:50 PM

#5204254 Rendering .obj Model in DirectX 11

Posted by fastcall22 on 14 January 2015 - 12:09 PM

Have you tried turning it on and off again?

#5199652 Boost c++ How to Deserialize Element of Container

Posted by fastcall22 on 23 December 2014 - 01:56 AM

Use an index table.

1. Reserve some space at the beginning of the file for the index table.
2. Serialize each entity, noting the write position of the stream, and store that and the entity ID into the table.
3. After serializing the entities, sort the table by entity ID.
4. Write the number of entities and the contents of the table to the beginning of the file.

When looking for a specific set of entities, all you'll need to do is to read the entire index, binary search for the entity IDs you're looking for, set the read position of the stream, then deserialize the entity. smile.png

#5199218 Chess moves

Posted by fastcall22 on 20 December 2014 - 12:43 AM

That is very disappointing. I guess I'll have to find some other programmer use for a 5TB external hard drive.

Oh, I know!! How about...



#5199041 C++ how to declare something that isn't declared?!?

Posted by fastcall22 on 18 December 2014 - 07:48 PM

It's not.

My guess is that WiredCat is trying to follow Borland convention or Pascal convention...

#5196679 Does ImageIO.read work in Java applets?

Posted by fastcall22 on 06 December 2014 - 02:20 PM

"Java applet"? What year is it??

#5195611 Crash with <unable to read memory> error

Posted by fastcall22 on 30 November 2014 - 09:09 PM

Check the object you're calling on; it could be null or invalid.

#5195610 *. not the same as ->

Posted by fastcall22 on 30 November 2014 - 09:04 PM

struct Foobar {
    int member;

int main() {
    Foobar f = {2};
    Foobar* ptr = &f;

    return (*ptr).member == ptr->member && ptr->member == f.member;

#5184826 Quaternion camera flipping constantly

Posted by fastcall22 on 03 October 2014 - 02:12 PM

I had a similar problem in the past. The problem was that I assumed quat::fromRotation(ang,x,y,z) == quat(ang,x,y,z), which isn't true. See Axis Angle to Quaternion.

#5184375 This chat, apparently, is a gigantic coding horror

Posted by fastcall22 on 01 October 2014 - 11:57 AM

Okay, dsm, I'm sorry for flying off the handle. I just got frustrated because you weren't understanding Unicode and/or HTML.
Anyways, it's not technically a blank line in much the same way " " isn't blank line. The difference is that the latter isn't allowed because it's recognized as just spaces, whereas the former is allowed, because it doesn't recgonize &​#x200B; as a non-printable character.

#5184370 This chat, apparently, is a gigantic coding horror

Posted by fastcall22 on 01 October 2014 - 11:42 AM

No, dsm, that's wrong. It's "&​#x200B;", which is a ZERO WIDTH SPACE, which I've been trying to explain to you this past half hour that it can be used to escape chars:

"__&​#x200B;A__" is displayed as "__A__", whereas
"__A__" is displayed as "&".

#5184232 This chat, apparently, is a gigantic coding horror

Posted by fastcall22 on 30 September 2014 - 11:43 PM

Okay. Now, just remember your order of operations from grade school:

PSycho Phil And Elvis Clean Noodles.
+ % & = , \n

#5184110 This chat, apparently, is a gigantic coding horror

Posted by fastcall22 on 30 September 2014 - 01:17 PM

So lots of little quirks about the chat.
Some people here discovered some time ago that typing the message "=A=" gives "__E&E__". Well, isn't that just the cutest little thing?

Today, I found out why.
I noticed when inspecting network requests to and from the chat, that "=" gets transformed into "__E__"
Hey, that's curious... looks a bit like an HTML entity would, doesn't it?

Sure enough, it seems a small handful of HTML entities are translated:
input output
__A__  &
__PS__ +
__C__  ,
__E__  =
So the original string, "=A=", expands to "__E__A__E__", but for some reason, "__A__" is replaced first, thus giving the strange "__E&E__". However, "__A__E__A__" is correctly contracted to "&E&".
This gives me the terrible feeling that someone somewhere is chaining string replace on the message like so:
message = message
... which doesn't make sense, since both PHP and javascript have a callback for regular expression replace:
$replacements = [
    "__A__" => "&", # or html equivalent
    "__PS__" => "+",
    "__C__" => ",",
    "__E__" => "="

preg_replace($message,"/__[A-Z]{1,2}__/g",function ($match) use(&$replacements) {
    return @$replacements[$match] ?: $match;

Sooo... wtf, IPS.

#5182957 Best comment ever

Posted by fastcall22 on 25 September 2014 - 01:16 PM

I sprinkle my code with such :
# (Coffeescript)

# TODO: derp, move this
numericSort = (a,b) -> a-b

# ...

# TODO: less huehue
ids = (_.pluckDeep models, '*.foo[*].bar[*].id').sort numericSort

#5181104 Multiples of 16B constant buffer or Microsoft gone mad.

Posted by fastcall22 on 17 September 2014 - 02:14 PM


Also, alignment.

#5181068 sign(a)

Posted by fastcall22 on 17 September 2014 - 12:44 PM



Sprry, didn't see HLSL tag