Custom post type single page uses the right template in preview mode but shows a different template after being posted

I’ve been developing a WordPress theme. I’ve created a custom post type called blog in functions.php.

// Blog Post Type Creation function te_blog_type() {     register_post_type("blog",         array(             "rewrite" => array("slug" => "blogs"),             "labels" => array(                 "name" => "Blogs",                 "singular_name" => "Blog",                 "add_new_item" => "Add New Blog",                 "edit_item" => "Edit Blog"             ),             "menu-icon" => "dashicons-format-status",             "public" => true,             "has_archive" => true,              "supports" => array(                 "title", "thumbnail", "editor", "excerpt", "comments"             ),             "taxonomies" => array("category", "post_tag", "blog_tag")         )     ); }  add_action("init", "te_blog_type"); 

It’s been working fine.

I also created a single-blog.php file as template for each blog post. When I preview the blog post. It’s using the right template from single-blog.php. However, when I actually post the blog, it’s showing the index.php as the template. What caused this?

Ubuntu On Stick: How it uses RAM

I want to make an ubuntu to go, have it installed in my flashdrive or harddrive (or if you can recommend a better portable drive where I should install it) so that I can use it anywhere.

Question is what RAM does it use? How?

Does it’s RAM usage function the same as dualboot OS? Or does it use virtual RAM from the same flashdrive where I installed it to? Or somewhere else I am clueless about?

And I hope there’s also an explanation because I am not knowledgeable on these things.

Connecting to VPN Initial Handshake Uses Encrypted or Unencryted Data?

I searched for a specific answer to this question and although there are many answers about VPN encryption, I did not find this specific question answered. Setup as follows:

MyPC -> VPN -> RestaurantISP -> Internet

When I first connect to my VPN service using either the OpenVPN protocol or the APP supplied by my VPN, does the initial TLS handshake send my username and password unencrypted or is that data sent encrypoted AFTERfter the connection to the VPN server has been established?

More specifically, if the RestaurantISP installs a packet sniffer, could they see my login details, like username and password?

If an Ancient Metallic Dragon uses Change Shape to turn into a humanoid with Innate Spellcasting, do the uses of “X/day” spells reset each time?

Ancient Metallic Dragons (e.g. Ancient Brass Dragons) have the Change Shape ability:

Change Shape. The dragon magically polymorphs into a humanoid or beast that has a challenge rating no higher than its own, or back into its true form. It reverts to its true form if it dies. Any equipment it is wearing or carrying is absorbed or borne by the new form (the dragon’s choice).

In a new form, the dragon retains its alignment, hit points, Hit Dice, ability to speak, proficiencies, Legendary Resistance, lair actions, and Intelligence, Wisdom, and Charisma scores, as well as this action. Its statistics and capabilities are otherwise replaced by those of the new form, except any class features or legendary actions of that form.

It is my understanding that the Spellcasting feature is a class feature and thus unavailable to an Ancient Metallic Dragon, but that the Innate Spellcasting trait is available to them.

Now, let’s take in example the Gloom Weaver humanoid from Mordenkainen’s Tome of Foes (p. 224), who has the following not-at-will Innate Spells:

1/day each: arcane gate, bane, compulsion, confusion, true seeing

If, say, an Ancient Brass Dragon decides to use Change Shape to turn into a Gloom Weaver, then decides to cast its 1/day true seeing, then uses Change Shape to revert to their dragon form, and uses it yet again to become a Gloom Weaver once more… does the dragon thus have a new use of true seeing?

In other words, does an ancient metallic dragon have essentially unlimited “X/day” innate spells by way of using Change Shape back and forth?

Are the definitions of constructs in terms of lambda terms issues in implementation/design or uses of functional languages?

In Lambda Calculus, natural numbers, boolean values, list processing functions, recursion, if function are defined in terms of lambda terms. For example, natural numbers are defined as Church numerals, and recursion is defined in terms of a fixed point of a function.

Functional languages are said to be based on Lambda Calculus.

Who shall be concerned about the above concepts in terms of lambda terms: the implementer/designer of the languages, and/or programmers in the languages?

  • Do functional programming languages define/implement the above concepts in terms of lambda terms?

  • As programmers in regular functional programming languages (such as Haskell, Lisp, ML), is it correct that the above concepts are always given in the same way as in imperative languages, and we never have to understand or deal with their definitions in terms of lambda terms?


If an arcane trickster rogue uses his mage hand and makes it invisible, does that mean anything the hand picks up is also invisible?

From PHB (emphasis mine):

Starting at 3rd level, when you cast Mage Hand, you can make the spectral hand invisible, and you can perform the following additional tasks with it:

• You can stow one object the hand is holding in a container worn or carried by another creature.

• You can retrieve an object in a container worn or carried by another creature.

• You can use thieves’ tools to pick locks and disarm traps at range.

You can perform one of these tasks without being noticed by a creature if you succeed on a Dexterity (Sleight of Hand) check contested by the creature’s Wisdom (Perception) check. In addition, you can use the bonus action granted by your Cunning Action to control the hand.

And the invisibility spell (emphasis mine):

A creature you touch becomes invisible until the spell ends. Anything the target is wearing or carrying is invisible as long as it is on the target’s person. The spell ends for a target that attacks or casts a spell.

I know the spell is slightly different but it’s the most comparable thing I could find.

For example:

  • I lift some jail keys off of a guard and then turn the hand invisible.

  • I grab 3 platinum coins off the mayor’s desk when I think no one is watching and close the hand around them so they’re totally inside the fist.

  • I give the hand a lockpick and pick a lock from across a crowded room.

In which of these situations (if any) would the objects be visible?

Ubuntu 18.04 doesn’t use my Radeon HD 8670M, uses intel instead

After a lot of research, I stumbled upon a problem I cannot resolve. I am trying to make ubuntu use my integrated Radeon graphics card (HD 8670M), but no matter what I try (and trust me, I did go over every single thread related to my problem here) Ubuntu doesn’t want to use it. Which is a problem, because the discreet intel one doesn’t support 3D acceleration. I have installed the open-source AMD driver already (xorg amd and mesa), but this doesn’t solve my problem. To add insult to injury when I run lscpi | grep VGA – only intel is listed. That being said – if I run lspci -nn | grep -E 'VGA|Display' I get this: 00:02.0 VGA compatible controller [0300]: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller [8086:0416] (rev 06) 01:00.0 Display controller [0380]: Advanced Micro Devices, Inc. [AMD/ATI] Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / Radeon 520 Mobile] [1002:6660] One more thing – when I run sudo apt-get upgrade I get the following odd message:

  The following packages have been kept back:   libgl1-mesa-dri libgl1-mesa-dri:i386 libglapi-mesa libglapi-mesa:i386   libglx-mesa0 libglx-mesa0:i386 libosmesa6 libosmesa6:i386 linux-generic   linux-headers-generic linux-headers-lowlatency linux-image-generic   linux-image-lowlatency linux-lowlatency ubuntu-desktop 0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded. 

Please advise on how to proceed.

Is there a linear-time algorithm to determine if an array has duplicate entries that uses only constant extra space?

Determining whether or not an array has duplicate entries has two straightforward solutions:

  • Build a hashset of entries, then search for elements in this hashset. This takes $ \mathcal O(n)$ time and $ \mathcal O(n)$ extra space.
  • Sort the array, then search for consecutive elements that are the same. This takes $ \mathcal O(n \log n)$ time and $ \mathcal O(1)$ extra space.

Is there an algorithm that can solve this problem with the best of both approaches, using only $ \mathcal O(n)$ time and $ \mathcal O(1)$ extra space?

Question Finding duplicate in immutable array in linear time and constant space is similar, but the solution to that question only works when the values come from the set $ \{1, …, n\}$ ; my values are large integers. Also unlike that question, I allow the input array to be modified and used as a workspace.

One strategy might be to attempt to turn the array into a kind of hashtable. However, this seems like it won’t work because of the lack of empty space (which makes both moving objects into place hard, as well as getting $ \mathcal O(1)$ queries.).

However, I suspect that this cannot actually be done, but I’m not sure how to go about proving it.

Is the language $L = \{(M,m,n)|\exists x \in \{0, 1\}^n:M$ uses $m$ space on input $x$$\}$ decidable?

I have stumbled upon this language: $ L = \{(M,m,n)|\exists x \in \{0, 1\}^n:M$ uses $ m$ space on input $ x$ $ \}$ . At first, it looked like an undecidable problem, but I have failed to prove it, and now I am beginning to wonder whether it is actually decidable.

I have designed the following algorithm. Let $ G_{M,x}$ be the configuration graph of $ M$ on input $ x$ (each node represents a snapshot of $ M$ , starting from $ M(x)$ ). To decide whether on $ x$ we use $ m$ space, we visit, DFS-style, each node of $ G_{M,x}$ starting from the first node. Each node can be computed from the prior node and we can memorize every node we have encountered so far into a data-structure. Now:

  • If we encounter a node which takes up at least $ m$ space, we halt and say yes.
  • If $ M$ halts before reaching size $ m$ or if we encounter a cycle (i.e. find a node we already visited), we stop and say no.

We apply the upper algorithm for each $ x \in {0, 1}^n$ , looking for at least an $ x$ on which we say yes.

Does this algorithm work? Why or why not? To me it sounds like it works, but I don’t know how to prove it. I guess we need to prove that this algorithm actually decides the problem and that it always halts.

Informally, I believe a way to prove this would be to say that we only have finitely many snapshots which represent less-than-$ m$ -space configurations: in a finite time, either we encounter some of them more than once (so we enter in a cycle) or we exceed the $ m$ -space limit. Either way, we halt and answer the question.

Accessing Gmail if you are the owner of domain that someone else uses

Say Person A (Adam) owns the domain, but is allowing free use of the domain name to his friend, Person B (Bill). As the owner of the domain, Adam logs into his registrar and points the nameservers to Bill’s host, GoDaddy. Bill hosts on GoDaddy and wants to use G Suite and Gmail. Bill then configures the MX records in the GoDaddy control panel to point to Gmail (e.g., ASPMX.L.GOOGLE.COM, etc), and everything works.

My question relates to security of Bill’s email: As Adam owns the domain name and is the only one with control of the registrar control panel, can Adam do anything from the registrar level to ultimately view Bill’s Gmail messages? Or, perform a sequence of steps to reroute, or make copies of Bill’s mail without their knowledge?