sso – Cookie set from a server to a client with different domain(via XHR), but not recognized by Client domain

I have three domains but the same code base (Domain X, Domain Y, Domain Z) and
Accounts website A

If a user tries to sign in accounts from domain X, I wanted to SSO in the other two domains (Browser Scenario: third party cookies blocked).

I tried the following approach,

  1. Go to Accounts from Domain X
  2. Sign In
  3. Get the required authentication token info and posts an XHR request to Domain Y to create a cookie.

When I check the request in Network, the required cookie is set in the response cookies, but when I open Domain Y separately the cookie is not present in the Application Cookies.

Can anyone please tell why the created cookie via XHR request is not accessible by the main domain? Kindly help.

Find the first 20 primes found by the classical proof of the infinitude of the set of primes

Begin with P={2}; then form,m, the sum of 1 with the product overall elements of P. Place the smallest prime factor of m into P and repeat.

Suppose p = {p1,p2,…,pr}, then m = 1+ p1p2p3…pr.

Example:

2 is prime and 2+1 = 3 is prime;

2 * 3 +1 = 7 is prime;

2 * 3 * 7 +1 = 43 is prime;

2 * 3 * 7 * 43 +1 = 1807 = 13 * 139, then 13 is the prime;

Thus the first 5 prime number found by the classical proof is {2,3,7,43,13}.

So how to use this proof to find the first 20 prime in Mathematica?
Thank you.

linux – Set xrandr DPI failure

I’m not exactly sure where to search for this, other than Google, which I have tried.

Normally, I use xrandr to set my DPI level after my Window Manager or DE has started. After making some xrandr layout changes, I get an error with running xrandr --dpi 120.

$ xrandr --dpi 120
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  7 (RRSetScreenSize)
  Serial number of failed request:  46
  Current serial number in output stream:  48

This issue began happening after I swapped my xrandr setup for HDMI-0 from --auto to --auto --scale 0.7x0.7.

My relevant i3 config:

exec --no-startup-id xrandr --output DP-2 --mode 2560x1440 --refresh 74.99 --primary --output HDMI-0 --auto --scale 0.7x0.7 --left-of DP-2
exec --no-startup-id xrandr --dpi 120

Previously, it was:

exec --no-startup-id xrandr --output DP-2 --mode 2560x1440 --refresh 74.99 --primary --output HDMI-0 --auto --left-of DP-2
exec --no-startup-id xrandr --dpi 120

I’m not exactly sure how to pinpoint the brokenness here, so out of desperation I’m inquiring superusers to see if they know of any relevant details regarding this problem.

turing machines – Is the set of recursive subsets of the set of natural numbers not r.e.?

I think that the set of recursive subsets of the set of natural numbers is not r.e. (meaning the set of codes of those subsets according to an admissible numbering).
I think I can provide the sketch of the proof of such statement and I would like to ask if what I write is correct.

PROOF SKETCH

This statement is equivalent to prove that the set of characteristic functions of recursive sets of natural numbers is not r.e., we are talking about recursive functions of this form: $f: mathbb{N} longrightarrow {0,1}$.
To be precise we are talking of the set of the codes according to an admissible numbering of those functions.

For any such function $f_k$ there is an infinite recursive binary sequence: $f_k(0), f_k(1),…,f_k(i),…: i in mathbb{N}$.
Let $TM_k$ be a Turing machine that on empty input outputs the binary sequence associated to $f_k$.

Let $widetilde{TM}$ be a Turing machine that enumerates those Turing machines $TM_k: k in mathbb{N}$ (to be precise it enumerates the codes of those Turing machines).

We can build a Turing machine $widehat{TM}$ that given as input the code of any Turing machine $TM_x$ runs both $TM_x$ and $widetilde{TM}$.
Then one of those two things must happen, either $TM_x$ halts or $widetilde{TM}$ outputs the code of
$TM_x$ which means $TM_x$ does not halt. So $widetilde{TM}$ can decide the halting problem (restricted to $TM$‘s with empty input but it is equivalent to the general halting problem, see this link), which is a contradiction.
So $widetilde{TM}$ can not be built, the set of $TM_k$ is not r.e. and so the set of recursive subsets of the set of natural numbers is not r.e. $blacksquare$

I assume the Turing degree of this set is $mathbf{0}’$ because an oracle for the halting problem make this set recursive.

set theory – Upper bound for constructibility orders of elements of the continuum

In a constructible universe (ZFC + V=L), is there any known upper bound for the constructibility orders of all elements of the continuum, i.e. some separately described ordinal $alpha$ such that we can prove $mathcal{P}(omega)subset L_alpha$ ? For example (under some large cardinal axiom), can it be proven that the first inaccessible cardinal is such an upper bound, or can this cardinal still fail at this ? I intuitively suspect undecidabilities in this matter but am no expert in the field. Thanks.

systemd – zfs is mounted after mongod starts: how do I set the boot order?

Fairly simple problem, I think, but I can’t seem to get my head around a fix.

I’m on Ubuntu 18.04.3 and mounting zfs volumes with mongo-data at boot correctly with the config below in /etc/systemd/system/multi-user.target.wants.

(Unit)
Description=ZFS startup target

(Install)
WantedBy=multi-user.target

Problem is that this happens after the mongod service is started, making mongod fail.

(Unit)
Description=MongoDB Database Server
Documentation=https://docs.mongodb.org/manual
After=network.target

(Service)
User=root
Group=root
EnvironmentFile=-/etc/default/mongod
ExecStart=/usr/bin/mongod --config /etc/mongod.conf
PIDFile=/var/run/mongodb/mongod.pid
# file size
LimitFSIZE=infinity
# cpu time
LimitCPU=infinity
# virtual memory size
LimitAS=infinity
# open files
LimitNOFILE=64000
# processes/threads
LimitNPROC=64000
# locked memory
LimitMEMLOCK=infinity
# total threads (user+kernel)
TasksMax=infinity
TasksAccounting=false
Restart=always
# Recommended limits for for mongod as specified in
# http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings

(Install)
WantedBy=multi-user.target

I read up about the WantedBy, Requires and After directives, but I’m not confident I understand them well enough to play around with them.

np complete – Set partition with an allowable difference

I have a variation of the partition problem, which is to partition the multiset S into two subsets S1, S2 such that the difference between the sum of elements in S1 and the sum of elements in S2 is smaller than K. I wonder if this is also a NP hard problem?

attachments – How do I set the browser icon on a PDF uploaded to Media Library?

I have uploaded PDF files to my site to allow visitors to view those PDFS.

When the visitor clicks on the link and the PDF is displayed, the icon in the browser tab changes to the WordPress logo.

Eg.

 https://example.com/wp-content/uploads/my_file.pdf

Show this header:

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>my file.pdf</title>
<!-- This snippet is used in the Firefox extension (included from viewer.html) -->
<base href="resource://pdf.js/web/">
 <script src="../build/pdf.js"></script>
<link rel="stylesheet" href="viewer.css">
  <script src="viewer.js"></script>
 </head>

How do I modify the ‘head’ tag to display my own site icon?

Getting Bootstrap Carousel to set Active class?

I have a Drupal 7 site that has 2 Bootstrap carousels.

  1. One that rotates automatically and takes up the width of the page.
  2. One that has 3 smaller items and only when the page is narrowed (e.g. on mobile device) does it need to rotate.

The first carousel works fine.

The second carousel does rotate until I manually add the “Active” to the class. Once I do it then begins to auto-rotate between the items.

<div id="carousel-posts" class="carousel slide carousel-posts" data-ride="carousel">
  <!-- Carousel items -->
  <div class="carousel-inner">
    <div class="item ">...</div>
    <div class="item ">...</div>
    <div class="item active">...</div>
    <div class="item ">...</div>
  </div>
</div>

I am trying to figure out how to set one of the items as ” active” when the page loads so that if the page is on mobile or resized to small enough it begins to auto-rotate.

I use nodequeue to order the items and bootstrap view to lay them out.

Thank you for any direction you can point me to.

unreal 4 – How to set up a sorting and tagging system for game assets in a moddable game?

I am building a game that is designed to be moddable under UE4.

I am going to have tons of assets (clothes, hairs, jewleries and their textures materials and whatnot) to deal with.

Eventually the game has to be localized for a bunch of non-latin character systems, too.

The easiest way would be to use a prefix/suffix system when naming the assets, which would come in the game in as Blueprints, containing the asset and some extra data as well. This would be a requirement for modders.

For example:

tag_othertag_clothname.uasset
tag          |name        

And then all I do is just search tru the name of the asset. I feed it the text the user typed for the name part, and the tags as strings for the tag part, and than hide the tag part from the user.

I set up a test scene and it does work ok with 500 assets, running the search every time you hit a button.

Later on I can store tag data in json or just as a plain string in the Blueprint.

The issue is that as the number of tags grow, the length of the string grows too, which can be a problem later on.

I thought about using strings and json files to store the tagging data in the Blueprint as well.

I would like to have 2 categories of tags by default

  1. region or body part: head, torso etc —> makes searching and
    categorizing very easy but not as efficient, can be appied to nearly all asset types

  2. asset type: cloth, jewlery, armour, etc

My questions are:

In your experience

  • are there pitfalls of using a prefix suffix system, for example security, performance, ease of use etc? if yes what are they?
  • what are the alternatives – I thought of using databases, but I don’t have much experience with them, not sure which one works best with a high number of Blueprints, I saw quite a few on the Marketplace…

I ‘d like to make it as simple as it can be, no overcomplication or overengineering.
I just want it to be usable, user friendly and easily extendable as the project grows.