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!


fastcall22

Member Since 04 Feb 2008
Offline Last Active Today, 10:11 PM

#5213011 Read data from specified adress of memory.

Posted by fastcall22 on 25 February 2015 - 09:09 PM

He doesn't want to read and write, he wants to read and write.


He doesn't want to "he doesn't want to read and write, he wants to read and write", he wants to "he doesn't want to read and write, he wants to read and write" with variables.


#5212635 Subtraction Problem in Java

Posted by fastcall22 on 24 February 2015 - 12:26 AM

floating point arithmetic anything in Java anything is an approximation


FTFY. Even in math and science, 1.333e0 + 1.333e1 will result in some loss in precision (1.466e1 != 1.4663e0), for four significant digits. Floating point math is no different.

EDIT:
I can't math. sad.png



#5211320 Programmatically search .fla Flash file for imported component

Posted by fastcall22 on 17 February 2015 - 07:29 PM

The problem is that flash files are in binary, and you're attempting to read them as text, which is a big no-no (in the general case). I'm assuming that you are only attempting to identify files having the component and nothing more. If this is the case, then you may be able to use any text editor with a "find all in files" feature.


#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...

...

...
 
Spoiler



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

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

Oberon:
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;
}
Hmm?


#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.
PS P A E C N
+ % & = , \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
    .replace("__PS__","+")
    .replace("__A__","&")
    .replace("__E__","=")
    .replace("__C__",",");
... 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.




PARTNERS