On the linear embedding complexity of subset of $0/1$ cube

$pi$ a subset of the $0/1$ integer points in $t$ dimensions represented by coordinates $(x_1,dots,x_t)$.

The answer to following problem is No.

Is there always a relationship
$$AXleq b$$
where length of $X=(X_1,X_2)$ is $theta(t^2)$ dimensions where $X_1,X_2$ are $theta(t^2)$ dimensions on the conditions

  1. Non-negative solutions of $X$ are in $0/1$

2.$X_1=(X_{1a},X_{1b})$ and $X_{1a}$ is of form $(underbrace{x_1,x_1,dots,x_1}_{r_1mbox{ times}},dots,underbrace{x_t,x_t,dots,x_t}_{r_tmbox{ times}})$ where $(x_1,dots,x_t)$ are the set of points in $pi$ if $X_1$ is non-negative and $X_{1b}$ is of form $(underbrace{1-x_1,1-x_1,dots,1-x_1}_{r_1’mbox{ times}},dots,underbrace{1-x_t,1-x_t,dots,1-x_t}_{r_t’mbox{ times}})$ where $(x_1,dots,x_t)$ are the set of points in $pi$ if $X_1$ is non-negative

  1. In 2. for every unique $X_1$ there is an unique $X_2$?

However is there a way to characterize subsets of $0/1$ cube where there is a single $A$ which can embed any set $pi$ in the subset as a linear subset in above sense where only the partitions $r_i,r_i’$ differ?

If we can increase $t^2$ to arbitrary polynomials and beyond (say exp or double exp) we can cover all subsets. But for now we are focusing on the smallest region.

Security risk of embedding JWT in URL?

I have a an endpoint, it redirects to an image which is stored on a storage service, I am considering if it is safe to embed the JWT in the url endpoint as such https://host/image?token=. This is the same JWT token which the system uses to decode and authenticate the user session. It works and allows me to ensure only a user logged into the system is able to access the storage url however does this impose any additional risks by placing the token in plain view instead of embedding it in the HTTP headers?

Thank you.

graph theory – Can Tutte embedding be guaranteed that each face is convex?

In graph drawing and geometric graph theory, a Tutte embedding of a simple 3-vertex-connected planar graph is a crossing-free straight-line embedding with the properties that the outer face is a convex polygon and that each interior vertex is at the average (or barycenter) of its neighbors’ positions. Tutte embedding

But I don’t know if this means that such embedding when first we fix any
arbitrary outer face (may be convex)
can guarantee that each face is convex.

For example, will the following non-convex face $f_1$ appear in Tutte embedding embedding? If it exists, is there a way to make each face convex?

enter image description here


Is graph’s planar embedding unique if each block of one planar graph is 3-connected?

A planar graph is one which has a plane embedding. Two drawings are topologically isomorphic if one can be continuously deformed into the other. If we wrap a drawing onto a sphere, and then off again, we can move any face to be the exterior face.

We know the following theorem.

Theorem (Whitney) If $G$ is 3-connected, any two planar embeddings are equivalent.

My question is as the title says.

Is graph’s planar embedding unique if each block of one planar graph is 3-connected?

Connectivity of the graph may even be one. I don’t know if there are any counterexamples or it may be true. Not sure if this is a proven fact.

PS: A block of a graph G is a maximal subgraph which is either an isolated vertex, a bridge edge, or a 2-connected subgraph.

Embedding Python function in C++

I have tried this link to embed Python function in C++ application. https://www.codeproject.com/Articles/820116/Embedding-Python-program-in-a-C-Cplusplus-code I am using Spyder for Python version 3.5 and Eclipse for c++ on Ubuntu Operating System. The program that is mentioned in this link is working properly but when I changed function then it is not accessing my function/program. Previous Python function includes:

def getInteger():
    print('Python function getInteger() called')
    c = 100*50/30
    return c

and the client C++ code:

#include <iostream>
#include <stdio.h>
#include <curses.h>
#include "Python.h"
#include <pyhelper.hpp>    
using namespace std;
int main() {
    CPyInstance hInstance;
    PySys_SetPath( L".:res/scripting:/home/madiha");
    CPyObject pModule = PyImport_Import(PyUnicode_FromString("pyemb3"));
    CPyObject pFunc = PyObject_GetAttrString(pModule, "getInteger");
    if(pFunc && PyCallable_Check(pFunc))
        CPyObject pValue = PyObject_CallObject(pFunc, NULL);
        printf("C: getInteger() = %ldn", PyLong_AsLong(pValue));
        printf("ERROR: function getInteger()n");

    printf("ERROR: Module not importedn");

    if(!getchar()) getchar();
    return 0;

it shows output as:

Python function getInteger() called
C: getInteger() = 166

Now I am changing code of Python function “getInteger” with the below code. and it is not accessing my function… no syntax error shown,…just go to else phase and shows “modue not imported”…although my Python function is working correctly when i run it separately….

 #!/usr/bin/env python
# coding: utf-8

# In( ):

# Import model
import pandas as pd
from sklearn.linear_model import LinearRegression
import pickle
# Read data
df = pd.read_csv('/home/madiha/Final_DataSet.csv')
tf = df
final_tf = pd.DataFrame(tf)
tf = df
final_tf = pd.DataFrame(tf)
# Create features variable, x
x_train = final_tf(('LocalLoadHigh', 'LocalLoadLow', 'TransitLoadHigh',
    'TransitLoadLow','phaseTotalBlocking', 'phaseTotalLocalBlocking', 'phaseTotalTransitBlocking', 'PBlockingLocalHigh',
    'PBlockingLocalLow', 'PBlockingTransitHigh', 'PBlockingTransitLow',
    'UtilizationHigh', 'UtilizationLow'))
    # Create target variable, y
y_train = final_tf('WavelengthGroup')
# Create linear regression object
lm = LinearRegression()
model = lm.fit(x_train,y_train)
def getInteger():
#    save the model to disk
    filename = 'finalized_model.sav'
    pickle.dump(model, open(filename, 'wb'))
    df = pd.read_csv('/home/madiha/workspace/IBKSIM/OneRowRegressionFiles/15_s1packetscheduler0.csv')
    tf = df
    final_tf = pd.DataFrame(tf)
    # Create features variable, x
    x_test = final_tf(('LocalLoadHigh', 'LocalLoadLow', 'TransitLoadHigh',
    'TransitLoadLow','phaseTotalBlocking', 'phaseTotalLocalBlocking', 'phaseTotalTransitBlocking', 'PBlockingLocalHigh',
    'PBlockingLocalLow', 'PBlockingTransitHigh', 'PBlockingTransitLow',
    'UtilizationHigh', 'UtilizationLow'))
    # load the model from disk
    loaded_model = pickle.load(open(filename, 'rb'))
    predictions = loaded_model.predict(x_test)
    return predictions

i think i have some issues while importing Python Function….

lower bounds – Number of planar graphs with linear edges, given a fixed embedding

I recently asked this question that asked about the number of planar graphs when I fix an embedding. Looking carefully into the answer I got, I found out that it assumed the edges can take any path in the plane, for as long as they don’t intersect.

I didn’t specify this in the previous question, but I am actually interested only in graphs whose edges are line segments that directly connect the two end-points, similar to how polygons do it.

So, simply put: what I’m asking is what is a lower bound / upper bound on the number of such graphs, when we fix an embedding for $n$ points beforehand?

Thanks in advance!

Security risks associated with embedding YouTube videos in a web application that needs authentication

We are developing a web application. It has several features so the first time the user enters it shows a short video explaining how to use it. We use the iframe approach to embed a video from YouTube (or potentially other streaming services like Vimeo, MS Stream, etc.). The video only shows for authenticated users (we use OpenId + OAuth2) and it will always be a video published by us (no third party content).

Talking with some colleagues about the potential security risks of this approach someone commented that it is not a good idea to embed external content in an authenticated web page because it is a hole through which a malicious user could inject code or gain access to information. Under the hypothesis that the streaming platform used (YouTube, Vimeo, etc.) is secure, and given that the content is controlled by us, I assume there is no security risk here. Googling about it has only reassured this idea. However, I am no expert, so I was wondering if there is something I am missing. Which are the security risks related to use an external video streaming provider in an authenticated web page?

On the other hand, supposing there are risks, I understand the alternative would be to host the video content directly on our servers, but that seems it is not a good idea either. Which are the security risks in this case?

malware – Embedding malicious code into an exe

How does malware usually embed into / infect exe files? (As in actually modifying the file on disk, not in memory). I’ve read it may look for gaps in the code section, insert its code, then redirect or change the entry point to that location. That makes sense, but what if there are no gaps large enough?

Would it be possible to insert bytes at the end of the code section, push everything else back, adjust the PE header/section sizes, then change the entry point to the new bytes? Or does something prevent this?

real analysis – Embedding into $mathbb{R}^6$

I am trying to find a map that goes from $S^2$ to $mathbb{R}^6$ such that it is an embedding. Im trying to use the fact that $S^2$ is compact and that I can find a map $psi$ that is an injective immersion which would then make $psi$ an embedding. Thinking about the Monge parametrization for the sphere i would get:

$$ psi(x,y,z) = (x,y, sqrt{1-x^2-y^2},0,0,0) $$

whose Jacobian matrix is:

$$ J(x,y,z) = left(begin{array}{cccc}
1 & 0\
0 & 1 \
frac{-x}{sqrt{1-x^2-y^2}} & frac{-y}{sqrt{1-x^2-y^2}} \
0 & 0 \
0 & 0 \
0 & 0
end{array}right) $$

but this only covers the top hemisphere, I could do a composition with the negative root but I find it problematic. For instance I can’t justify that the rank of the Jacobian is $3$ so I couldn’t say its an immersion. Is there an injective immersion from $S^2$ to $mathbb{R}^6$?