-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
infinite nullspace on standalone page #12
Comments
Same happens when I save a local copy of https://mlweb.loria.fr/lalolab/lalolib.html |
First, note that Lalolab performs all computations in a separate web worker. |
The weird thing is that it hardly takes any time when tried on https://mlweb.loria.fr/lalolab/index.html |
Tried again with example 2 and 3 but now I get
Tried to tweak the following code with a local copy of both <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
<script type="application/x-javascript" src="http://mlweb.loria.fr/lalolib.js "></script>
</head>
<body>
<script>
var lab = new Lalolab() ; // open a standard Lab
// define a variable in the current scope
var A = [[0,0,0,0,0,0,0,1,0,0,0,0,1,-1,0,-1,0,-1,0,0],[0,0,0,0,0,0,1,-1,0,0,-1,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,-1],[0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,-1,1,0,0],[0,0,1,0,0,0,0,0,1,-1,0,0,-1,0,0,0,0,0,0,0],[1,0,0,0,1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,1,0,0,0,1,1,-1,0,0,0,0,0,0,-1,0],[0,-1,0,0,0,0,0,0,0,0,0,1,0,0,-1,1,0,0,0,0],[0,0,-1,1,-1,0,-1,0,0,0,0,0,0,0,1,0,0,0,0,0],[-1,1,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,1,0,0,1],[0,0,0,0,0,0,0,0,0,1,0,0,-1,-1,0,0,0,0,1,0],[0,0,1,0,0,0,-1,-1,0,0,0,0,1,0,0,0,0,0,0,0],[0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,-1,-1],[0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,-1,-1,0,1],[1,0,0,0,0,1,0,0,-1,-1,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,-1,-1,1,0,0,0,1,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,1,0,0,-1,-1,0,0,0,1,0,0,0,0],[0,0,0,1,0,0,0,0,0,0,0,0,0,0,-1,-1,0,1,0,0],[0,0,-1,-1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0],[-1,-1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]];
lab.load(A, "A", function (result) { // load the variable in the lab
res3.innerHTML = "The matrix A = " + laloprint(result,true) + " has been loaded in the lab.<br>";
});
lab.do("n = nullspace(array2mat(data))"); // do some computation in the background
lab.getObject("n", function ( result ) { // recover the value of a variable from the lab
res3.innerHTML += "The nullspace of A is stored in the lab variable n which equals " + result;
}); </script>
</body>
</html> |
If you use a local copy, you need to execute chrome wth additional flags so that it allows other js files.
Look at the "chromelab" executable in lalolab folder for the precise flag.
Fabien.
… De: "Jo Pol" ***@***.***>
À: "lauerfab/MLweb" ***@***.***>
Cc: "moi" ***@***.***>, "Comment" ***@***.***>
Envoyé: Mercredi 23 Septembre 2020 20:46:47
Objet: Re: [lauerfab/MLweb] infinite nullspace on standalone page (#12)
Tried again with example 2 and 3 but now I get
Security Error: Content at file:///XXX.html may not load data from
http://mlweb.loria.fr/lalolibworker.js.
Tried to tweak the following code with a local copy of both .js files but I'm
too unfamiliar with these things to succeed.
<!DOCTYPE html > < html lang =" en " > < head > < meta charset =" UTF-8 " > <
title > test </ title > < script type =" application/x-javascript " src ="
http://mlweb.loria.fr/lalolib.js " > </ script > </ head > < body > < script >
var lab = new Lalolab ( ) ; // open a standard Lab // define a variable in the
current scope var A = [ [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , -
1 , 0 , - 1 , 0 , - 1 , 0 , 0 ] , [ 0 , 0 , 0 , 0 , 0 , 0 , 1 , - 1 , 0 , 0 , -
1 , 0 , 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, 0 , 0 , 0 , 1 , 0 , 0 , - 1 , - 1 , 0 , 1 ] , [ 1 , 0 , 0 , 0 , 0 , 1
, 0 , 0 , - 1 , - 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] , [ 0 , 0 , 0 , 0
, - 1 , - 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] , [ 0 , 0
, 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , - 1 , - 1 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 ] ,
[ 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 1 , - 1 , 0 , 1 , 0
, 0 ] , [ 0 , 0 , - 1 , - 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1
, 0 , 0 , 0 ] , [ - 1 , - 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1
, 0 , 0 , 0 , 0 , 0 ] ] ; lab . load ( A , "A" , function ( result ) { // load
the variable in the lab res3 . innerHTML = "The matrix A = " + laloprint (
result , true ) + " has been loaded in the lab.<br>" ; } ) ; lab . do ( "n =
nullspace(array2mat(data))" ) ; // do some computation in the background lab .
getObject ( "n" , function ( result ) { // recover the value of a variable from
the lab res3 . innerHTML += "The nullspace of A is stored in the lab variable n
which equals " + result ; } ) ; </ script > </ body > </ html >
—
You are receiving this because you commented.
Reply to this email directly, [
#12 (comment) | view it on
GitHub ] , or [
https://github.com/notifications/unsubscribe-auth/ADNPBCEVIB3OLBOPTEKJBTLSHI7BPANCNFSM4PIPHA7Q
| unsubscribe ] .
|
I'd like to apply these scripts on a public website. I can't and should not ask from non-tech users to circumvent security measures against cross-site scripting |
Let me return to the original issue. I want to do a nullspace calculation client-side by JavaScript on a public web page. The calculation runs quickly on https://mlweb.loria.fr/lalolab/index.html but takes forever when tried in example-1 on https://mlweb.loria.fr/lalolab/lalolib.html |
Tried it publicly with https://github.com/jo-pol/test-lalolib/blob/master/index.html published at https://jo-pol.github.io/test-lalolib/ Now I get
Could you please replace |
I tried a nullspace calculation which seem to run forever in a standalone web-page. The same two JavaScript lines run quickly on https://mlweb.loria.fr/lalolab/index.html
I tried to import the script from the head section as shown below, tried also in the body, in both cases with and without the type attribute. Tried firefox and chrome. What am I missing?
The text was updated successfully, but these errors were encountered: