Open File By Browser & Set Mouse Position By VTK

Open File By Browser The FileReader object lets web applications asynchronously read the contents of file. You can feel the effect at: https://www.weiy.city/web-test/open-file/ <!doctype html> <html lang=”en”> <head> <title>Test</title> </head> <body> <input type=”file” id=”file-input” /> <h3>Contents of the file:</h3> <pre id=”file-content”></pre> <script> function displayContents(contents) { var element = document.getElementById(‘file-content’); element.textContent Read more…

Export CPlusPlus Algorithm To Javascript Code

I will show a way to export CPlusPlus algorithm to javascript code. Write Pollard’s rho algorithm in class Resolver for integer factorization. resolver.h #include <string> typedef long long LL; class Resolver { public: Resolver(); ~Resolver(); std::string GetResolvedResult(int x); protected: void find(LL n,LL c); bool Miller_rabin(LL p); LL Pollard_rho(LL n,LL c); Read more…

HTML: Render Math Formula By MathJax

We will render math Formula in browser by Js engine MathJax. Download the mathjax package to host it from our own server. git clone https://github.com/mathjax/MathJax.git mj-tmp mv mj-tmp/es5 <path-to-server-location>/mathjax rm -rf mj-tmp Write a JS file which import mathjax to analyze string which contains latex math code. check-for-tex.js: (function () Read more…

Make Your WordPress Website Has The Ability To Check Network Connection.

The post introduce a way to make your wordpress website has the ability to check network connection. Install the plugin Insert Headers and Footers for wordpress. Add the following code in header part. <script> if (“serviceWorker” in navigator) { navigator.serviceWorker.register(“/serviceworker.js”) .then(function(registration) { console.log(“Service Worker registered with scope:”, registration.scope); }).catch(function(err) { Read more…

Tex To PDF
: convert the Latex file which suffix is tex to a PDF file

X