How does the following script manage to pull data from an external domain without requiring CORS headers?

Script in Question: http://samples.geekality.net/image-fetcher/

You can click "view source" at the bottom to pull up the exact PHP and Javascript being used.

I used part of this script to extract images on a site of mine from another on separate domains and servers. I had to go to the one being scraped and add a CORS header "Access-Control-Allow-Origin" to allow my specific domain to do the AJAX $ .post and actually receive data.

The script above does not require any site to have the CORS header for security. As far as I can tell I’m doing nothing different.

I have an HTML form then I’m grabbing the field data with jQuery and doing a $ .post where the action is a PHP file that uses DomDocument to grab the HTML. The PHP then sorts through the data and echoes a JSON object. Then the jQuery sorts it all out and displays it on the page. Same thing they’re doing.

I can’t see how they’re getting around the need for a "Access-Control-Allow-Origin" header on the site they’re grabbing images from?

Thanks for your time and energy in this!

Unity2D – Rotation of gun following mouse error when parent ‘player’ object rotates

I have a bug I’ve been trying to fix with the rotation of a gun object that follows the mouse position but has issues when the parent object player rotates. Example:

Example of rotation error

The player has a gravity script to keep them aligned with the ‘planet’ as you walk around it. The gun as a child of the player, is supposed to always rotate to point at where the mouse is (sorry you can’t see it in the gif). The gun normally flips itself at 90 and -90 (top and bottom), and flips the player to face the same side the mouse is on.

The problem is that the player rotates to stay aligned with the planet, but the 90 and -90 angles that the gun bases flipping itself and the player off of course don’t rotate.

Here’s my code for the gun:

         Vector3 difference = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position;           difference.Normalize();           float rotationZ = Mathf.Atan2(difference.y, difference.x) * Mathf.Rad2Deg;            float startRotation = rotationZ + offset;            float shotRotation = startRotation + Random.Range(-scatter, scatter);            transform.rotation = Quaternion.Euler(0f, 0f, startRotation);            //Flip the gun at top and bottom           if (rotationZ < -90 || rotationZ > 90)           {               if (player.transform.eulerAngles.y == 0)               {                   transform.localRotation = Quaternion.Euler(180, 0, -rotationZ + offset);               }               else if (player.transform.eulerAngles.y == 180)               {                   transform.localRotation = Quaternion.Euler(180, 180, -rotationZ + offset);               }           }            //Use gun rotation to set player direction           //left           if (rotationZ >= -90f || rotationZ <= 90f)           {               animator.SetFloat("Vertical", 0);               animator.SetFloat("Horizontal", -1);           }           //right           if (rotationZ <= -90f || rotationZ >= 90f)           {               animator.SetFloat("Vertical", 0);               animator.SetFloat("Horizontal", 1);           }

Select all rows that have all of the following column values

I have the following tables Genres, Films, Directors. They have the following schema:

CREATE TABLE GENRES(     GID INTEGER PRIMARY KEY,     GENRE VARCHAR(20) UNIQUE NOT NULL );  CREATE TABLE Films(     FID INTEGER PRIMARY KEY,     Title VARCHAR(45) UNIQUE NOT NULL,     DID INTEGER NOT NULL,     GID INTEGER NOT NULL,     FOREIGN KEY (DID) REFERENCES Directors(DID),     FOREIGN KEY (GID) REFERENCES Genres(DID) );  CREATE TABLE Directors(     DID INTEGER PRIMARY KEY,     First_Name VARCHAR(20) NOT NULL,     Last_Name VARCHAR(20) NOT NULL ); 

I want to write a query that will allow me to select all of Director information for every director that has made atleast one movie in the same genre(s) as another director. For example if Stanley Kubrick has made films in genres ‘Sci-Fi’, ‘Thriller’, and ‘Crime’, I want to select all the directors who have made at least 1 sci-fi AND 1 thriller AND 1 crime film.

I’ve tried the query seen below but this will give me directors who have made atleast 1 sci-fi OR 1 thriller OR 1 crime film.

SELECT DISTINCT D.DID, D.First_Name, D.Last_Name FROM Directors D LEFT JOIN Films F ON F.DID = D.DID LEFT JOIN Genres G ON G.GID = B.GID WHERE G.Genre IN (   SELECT DISTINCT G1.Genre   FROM Generes G1   LEFT JOIN Films F1   ON F1.GID = G1.GID   LEFT JOIN Directors D1   ON D1.DID = D1.DID   WHERE D1.First_Name = 'Stanley'   AND D1.Last_Name = 'Kubrick' );  Additionally, I am not able to check before hand which Genres the director in question has been involved with. The query should work with the only given information being the Directors First and Last name. 

Are the monsters in the MM actually following the monster creation rules?

The guidelines for making your own monsters are based around the Monster Statistics by Challenge Rating table on p274. Inspired by this question regarding Animated Armor (MM 19), which is CR1, let’s see where the Armor would be if we made it from scratch…

Defensive CR: The Armor has 33 HP, but step 9 (Damage Vulnerabilities, Resistances and Immunities, DMG 277) has us adjust effective HP based on resistance.

So we start with 33 HP, giving us CR 1/8, which tells us that we’re using the first line of Effective Hit Points Based on Resistances and Immunities, for an x2 multiplier for each Resistance or Immunity.

The Armor has two Immunities, so has 33x2x2 or 132 “effective” hit points. That puts us at CR 5. We then look at its AC of 18, which is 3 higher than the normal 15 for CR 5. That adjusts us up by one, to CR 6.

Offensive CR: It does 10 (2×5) points of damage, for a CR of 1. Its Attack Bonus is +4, which is 1 higher than the normal +3, but doesn’t adjust CR up.

Final CR is the average of the two, or (6+1)/2. That gives us 3.5, which we round against the players, for a final final CR 3.

How is Animated Armor a CR1 challenge? Its only notable disadvantage (from a combat perspective) is its Antimagic Susceptibility, but that has no effect on CR, per DMG 280. What’s knocking it down from CR 3 to CR 1? Or am I horribly misunderstanding how the creation rules work?

I’d like to do some flashy combat stunts and still deal sneak attack damage. Are the following mechanically possible to do in game?

Feats used

  • Twin Throw: As part of full attack action throw ranged weapons using one attack roll

  • Ranged Feint: Feint using a ranged weapon

  • Two Weapon Feint: Sacrifice an attack to use Feint

  • Throw and Charge: As a full round action, you can throw a light or one-handed ranged weapon, draw another weapon, and then charge. Both attacks are made at your highest BAB with a +2 bonus to your charge attack.

Set up: Initiate Twin Throw (assumed throwing with primary and offhand) use one of the two attacks to do a Ranged Feint. If successful, the second attack can do sneak attack damage followed by what ever method you choose to deliver a the charge attack. (Roundhouse kick, uppercut, shoulder charge, clothes line, Guile’s Flash Kick) With Twin Throw you have 2 chances to do a Ranged Feint and still catch a target flat footed with the charge.

Given the following constraints what is the maximum number of attacks in a round for 3.X edition?

A former DM has had the same recurring NPC/GMPC since I started playing in his game. This was 20+ years ago and we started in 1st edition and slowly made our way through the years and editions. We updated our characters as we went to the new editions. Now this NPC/GMPC is the most reviled in his games, any time he shows up all the players immediately want him dead. We stick to character though.

The question will be broken up to hopefully get expert answers from each of the editions in which we played in this particular question it will be specific to 3.Xe. I am skipping 4e (as we all hated it and only played one session) and 5e because I know for a fact that it is not possible there (yet).

The question is as follows:

Give the following constraints what is the maximum number of attacks in this edition:

  1. NPC is an Elf (In this edition it is irrelavent I suppose).
  2. He was a Thief-Acrobat in previous editions and I assume multiclassed, probably Fighter-Thief, due to how 3.X prestige works let’s assume just Rogue for this edition, although any official prestige class is fair game. Character focused on tumbling and thrown knife attacks.
  3. The weapon of choice was throwing knives.
  4. Assume unlimited ammunition as he had a bandalier that had the knives return.
  5. I know he could throw 3 knives at a time (pretty sure this was a thing for shuriken from Oriental Adventures).
  6. Assume all official sources and Dragon Magazine since the first issue are open.
  7. I know of this question and assume there is a variant with knives.
  8. If I recall he threw with both hands as well.
  9. Assume prestige classes are open, this DM even as a player had a tendency to stack multiclass options with min/max precision but assume Rogue is the primary focus.
  10. Assume Quick Draw.
  11. We were always between 8th and 15th level when I met this character.
  12. I do not recall spell-casting but not ruling it out entirely but main build would likely have been focused on mundane means.
  13. Assume focused magical item augmentation as well, just calling it out even though the aforementioned bandolier alluded to it, but for the most part official items other than that.
  14. Assume no flying invisible helpers as suggested by HeyICanChan or for that matter third party interventions or Aid Another.

The end result in game was quite literally at least 2 dozen attacks per round, perhaps more. Which I have questioned him multiple times about the build and legitimacy but he as refused to provide any answers. I know DMs do not have to justify but this, combined with a number of other things over the years has lead to distrust. I have since stopped playing his games altogether, so this is just a verification on whether I have overreacted.

This was broken into 3 questions for each of the editions.

AD&D, AD&D 2nd Edition, and Dungeons & Dragons 3.X.

Does the duration of the invisibility from the Firbolg’s Hidden Step trait allow me to make an attack roll with advantage on the following turn?

The firbolg’s Hidden Step trait (VGtM, p. 107) is described as being active "until the start of your next turn" at most:

As a bonus action, you can magically turn invisible until the start of your next turn

I’m unclear on the exact mechanics of turn starts. For instance, if I use Hidden Step as a bonus action at the end of my turn, would the invisibility stay active for my next attack?

My initial reading was "no" as the trait would stay active from when I use it, into the next round, and drop as soon as my turn came up in the initiative order. I would then become visible, and take my action. This also gels conceptually: I can use Hidden Step to protect myself from combat for a round, or I can use it to gain advantage on an attack. But I can’t use it for both.

However, I’ve also read that advantage for invisibility is determined at the start of the round, and thus the advantage would in fact carry over to the next round’s attack, as if I was attacking from hiding or something similar.

Which is it, and what source would resolve it?