Google crawls site.com/my-category/0/page/* urls that are not supposed to exist

Google reported a schema error on a page on my website which should not exist:

mysite.com/my-category/0/page/25

my-category does not have 25 pages. It only has 3 pages. I checked the other categories and I can access those pages with /0/ on the URL as well.

my-category pages should only be

mysite.com/my-category/page/2

Only the main archive page, which has all the POST, should have 25 pages.

Is there a setting that I need to update, or a hook that needs filtering to remove those URLs with /0/ on the URL? Those need to be 404.

SQL Query to Return Rows that don’t exist as blank

I have a database of information of a possible 1-100 rows. The issue is some of the numbers don’t exist.

When I run a query the following results are retuned:

Unit,Location,Name,Description
1,1,a,xxxx
1,2,a,xxxx
1,3,a,xxxx
1,6,a,xxxx
1,7,a,xxxx
1,9,a,xxxx
1,10,a,xxxx

How can I get the following result instead:

Unit,Location,Name,Description
1,1,a,xxxx
1,2,a,xxxx
1,3,a,xxxx
1,4,-,—-
1,5,-,—-
1,6,a,xxxx
1,7,a,xxxx
1,8,-,—-
1,9,a,xxxx
1,10,a,xxxx

Given a set of SQL scripts, does there exist software that generates a dependency tree of SQL scripts starting with the root SQL script?

I have a about 100 *.sql scripts located in a directory (let’s say script1.sql, script2.sql, …., script100.sql).

Some of these scripts create tables, some create triggers, some create functions, etc..

Without manually looking through each of the 100 scripts, it is not immediately clear to me which script depends on other scripts.

Is there a software/program out there that, when given as input a directory of SQL scripts, can output a dependency tree, starting with the root SQL script?

Run calculation not working in sub query, “does not exist”

PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit 

I have a query that provides the count of 2 things over 2 time periods:

  • time period of this week, start of the week (Sunday/Monday midnight) -> today
  • time period of last week, start of last week (Sunday/Monday midnight) -> today but last week

What I would like is to also perform a calculation on the two "car" count ints that are returned and provide this with the query result.

I can of course do this in the consuming app, but I’d love to be able to do it in my SQL.

Working SQL

This is the base SQL and is what I currently have and working:

WITH last_week AS (   SELECT COUNT(car_name) as car_count_last_week   FROM car_store   WHERE car_name = 'awesome'   AND car_time >= date_trunc('week', CURRENT_DATE - INTERVAL '1 week')   AND car_time <= CURRENT_DATE - INTERVAL '6 days' ), current_week AS (   SELECT COUNT(car_name) AS car_count_current_week   FROM car_store   WHERE car_name = 'awesome'   AND car_time >= date_trunc('week', CURRENT_DATE)   AND car_time <= CURRENT_DATE ) SELECT car_name,   date_trunc('week', CURRENT_DATE - INTERVAL '1 week') AS start_of_last_week,   CURRENT_DATE - INTERVAL '6 days' AS today_but_last_week,   date_trunc('week', CURRENT_DATE) AS start_of_current_week,   CURRENT_DATE AS today,   car_count_last_week,   car_count_current_week   FROM car_store   CROSS JOIN last_week, current_week   WHERE car_name = 'awesome'   GROUP BY car_name, car_count_last_week, car_count_current_week   ORDER BY car_name; 

Setup DB table

CREATE TABLE IF NOT EXISTS car_store (      car_id INT GENERATED ALWAYS AS IDENTITY,      car_time TIMESTAMP NOT NULL,      car_name VARCHAR(255) NOT NULL,      PRIMARY KEY(car_id)   )  INSERT INTO car_store(car_name, car_time) VALUES ('awesome', '2021-05-03 15:28:00.116594'); INSERT INTO car_store(car_name, car_time) VALUES ('awesome', '2021-05-11 16:13:07.217903');  INSERT INTO car_store(car_name, car_time) VALUES ('awesome', '2021-05-01 18:03:27.217903');  INSERT INTO car_store(car_name, car_time) VALUES ('awesome', '2021-05-14 18:03:27.217903');  INSERT INTO car_store(car_name, car_time) VALUES ('awesome', '2021-05-12 18:03:27.217903');  INSERT INTO car_store(car_name, car_time) VALUES ('awesome', '2021-05-13 18:03:27.217903');  

Thing that causes error

I would like add the following code – to calculate difference_between_weeks:

ROUND(car_count_current_week/(car_count_last_week/100) - 100)     AS difference_between_weeks 

I have tried calculating in the columns, I have tried adding another sub query. But I don’t seem to be able to calculate the difference_between_weeks as it tells me "does not exist" or ERROR: division by zero

Full SQL that errors

An example of the SQL with the added code that errors:

WITH last_week AS (   SELECT COUNT(car_time) as car_count_last_week   FROM car_store   WHERE car_name = 'awesome'   AND car_time >= date_trunc('week', CURRENT_DATE - INTERVAL '1 week')   AND car_time <= CURRENT_DATE - INTERVAL '6 days' ), current_week AS (   SELECT COUNT(car_time) AS car_count_current_week   FROM car_store   WHERE car_name = 'awesome'   AND car_time >= date_trunc('week', CURRENT_DATE)   AND car_time <= CURRENT_DATE ) SELECT car_name,   date_trunc('week', CURRENT_DATE - INTERVAL '1 week') AS start_of_last_week,   CURRENT_DATE - INTERVAL '6 days' AS today_but_last_week,   date_trunc('week', CURRENT_DATE) AS start_of_current_week,   CURRENT_DATE AS today,   car_count_last_week,   car_count_current_week,   ROUND(car_count_current_week/(car_count_last_week/100)) - 100 AS difference_between_weeks   FROM car_store   CROSS JOIN last_week, current_week   WHERE car_name = 'awesome'   GROUP BY car_name, car_count_last_week, car_count_current_week   ORDER BY car_name; 

Returned error

I get the following error:

ERROR:  division by zero SQL state: 22012 

I feel like I am close but I also feel this may not be possible? Any pointers to what I am missing would be hugely appreciated.

Please let me know if I have missed something?

Thanks

Parameter ‘Walk’ doesn’t exist?

I’m trying to make walk animation. But when I try to change animation idle to walk, ıt doesn’t work. It says ‘Parameter "Walk" doesn’t exist’but I added parameter and script works. I can manually change parameter and it works(walk animation is playing). But when I try to change via script, ıt doesn’t work.

enter image description here

Here are codes

public class Controller : MonoBehaviour     private Rigidbody rb;  private float xPos;  Vector3 playerMovement;  [SerializeField] Animator anim;      private void Awake() => rb = GetComponent<Rigidbody>();  private void Start() {           xPos = transform.position.x;  }         // Update is called once per frame void Update() {     Move();      }  private void Move() {          float mH = Input.GetAxis("Horizontal");       playerMovement = new Vector3(0, 0, mH);      rb.AddForce(playerMovement * 2f);      anim.SetFloat("Walk", 1);      transform.position = new Vector3(xPos, transform.position.y, transform.position.z);       } 

Select list of attributes that exist in all groups

select distinct(p) from Pub; /* phdthesis article proceedings incollection inproceedings www book mastersthesis */ select * from field limit 20; /* tr/meltdown/s18,0,author tr/meltdown/s18,1,author tr/meltdown/s18,2,author tr/meltdown/s18,3,author tr/meltdown/s18,4,author tr/meltdown/s18,5,author tr/meltdown/s18,6,author tr/meltdown/s18,7,author tr/meltdown/s18,8,author tr/meltdown/s18,9,author tr/meltdown/s18,10,title tr/meltdown/s18,11,journal tr/meltdown/s18,12,year tr/meltdown/s18,13,ee tr/meltdown/m18,0,author tr/meltdown/m18,1,author tr/meltdown/m18,2,author tr/meltdown/m18,3,author tr/meltdown/m18,4,author tr/meltdown/m18,5,author */ 

pub and field join on column k (primary key)

I want to write a query that returns only those attributes (author/journal/year etc.) that have at least one record in every publication type: phdthesis, book, etc.

Do external, non-innate methods exist in Faerûn circa 1489 DR to situationally alter the efficacy of spellcasting?

Prior to D&D5e, Forgotten Realms lore included various situational methods and circumstances that could change the way spells and spellcasting worked. For example, the 1e product Volos’ Guide to All Things Magical includes a lengthy section on the use of various materials as special spell components. Using, say, a star sapphire in the casting of globe of invulnerability would increase level of spells warded off by the globe (see VGtATM p. 51). On the other hand, consuming the herb spellbane detailed in the 2e product Volo’s Guide to Cormyr would entirely suppress spellcasting ability for a period of time (VGtC p. 110).

Faerûn has changed a lot across editions, however, and nowhere is that more true than in the way magic and spells work. Maybe those old methods of amplifying or weakening spells and spellcasting are still effective, or maybe they aren’t. Is there any lore either way in 5e-era publications, i.e., in the Realms as they are post-Second Sundering, circa 1489 DR? Are there any other, different but comparable methods available?

To be clear, I’m interested here in methods that are temporary, ephemeral, and external to the caster and/or target — not innate abilities, learned skills, divine gifts, etc. Magic items are fair game, as are special substances (magical or otherwise). Even locations with special properties that change the way spells function would fit the bill.

If undead exist, why do cemeteries exist & cremation not a standard?

I have less fingers than the nr of cemeteries I cleared in campaigns of various scenarios and game mechanics. I find time and time again cemeteries crawling with undead. Either graves or crypts.

I understand the exotic/horror nature of a cemetery but if it happens once, twice, a million times, surely some peasants can get the hint and burn their dead?

A friend said that improper burial through fire angers the god who wants xyz ritual, that some undead are ghosts & other incorporeal undead BECAUSE they can’t find their body so they throw a major ragequit.

Surely there must be a better reason.

What mechanical implications exist when allowing duplicate stronghold types in a castle?

Matt Colville’s supplement Strongholds & Followers details, among other things, rules for building optional strongholds and castles, with castles being complexes of multiple strongholds.

The strongholds are divided into four broad types: keeps, towers, temples, and establishments. A stronghold (of any variety) can be controlled by only one PC at a time, and can only offer its most direct benefits to that character. On page 11 of Strongholds & Followers the rules state that castles cannot contain more than one of each stronghold type.

A castle cannot contain multiple of the same type of stronghold. If you build a castle with two towers, for instance, only one of them grants the benefits of spell research. Also, a stronghold’s benefit only applies to one character at a time. (Strongholds & Followers, page 11)

I am running a game using these rules in which two PCs (a Wizard and a Sorcerer) will almost certainly want to build a tower each. Even if they don’t, the party has no use for a temple (or variant on a temple, like a Druid’s Grove). With four players that means that unless there is at least one duplicate stronghold type, at least one player will be left out. This is easy enough to just overrule (I plan on allowing two towers), but I’m curious about why the restriction on duplicates exists. I have not found anything in the book itself.

Is there a mechanical implication to duplicating stronghold types within a single castle?

How do I check if the same item exist in plist and SpriteKit?

I am trying to make a RPG game in IOS, with a similar dialogue system in Baldurs Gate. I have created two arrays in a plist file. Like this:

Plist file

As you can see I have two arrays: PlayerMessage; a list (it will be) of multiple choices that the player can touch and NPCMessages; the text that is displayed when the PlayerMessage is touched

I am at the stage where I can touch on the NPC and see a black box with text from array (PlayerMessage). However I do not know how to tell Swift, if a player touches the string of the Item in PlayerMessage and if same item exist in NPC Message display the string of that item.

Here is the code that I have used:

    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {          for touch in (touches) {                  NPC.name = "NPC"                  let Location = touch.location(in: self)                                          var CorrectedLocation = CGPoint()                     CorrectedLocation.x = Location.x - LocalCamera.position.x                     CorrectedLocation.y = Location.y - LocalCamera.position.y          let node = self.atPoint(CorrectedLocation)         var Message: SKLabelNode!         Message = SKLabelNode(fontNamed: "Trebuchet MS")          if (node.name == "NPC") {             let NPCMessageer = SKSpriteNode (color: UIColor.black, size: CGSize(width:1000, height:1000))             NPCMessageer.zPosition = 99             NPCMessageer.position = CGPoint(x:-500, y:-200)           Message.fontSize = 50             Message.color = UIColor.white;            Message.position = CGPoint(x:-500, y:-100)             Message.zPosition = 100              addChild(NPCMessageer)             self.addChild(Message)             for PlayerMessage in NPC.PlayerMessage {              Message.text = PlayerMessage as?String}             let label = self.atPoint(CorrectedLocation)             if label.name == "Message"             {                                                if NPC.PlayerMessage == NPC.NPCMessage              {                 Message.text = NPC.NPCMessage as?String              }