Is there a software can execute the wasm file out of the Browser? - windows

I downloaded a PSX emulator (mamepsx.wasm.gz and mamepsx.js.gz) from archive, then I tried to write a html file to load the js file, but it doesn't work.
<html>
<head>
<script src="mamepsx.js"></script>
</head>
</html>
Is there a software can execute the wasm file out of the Browser or just assmbly the wasm file into a Windows executable file?

Related

Laravel 5 recognizes some css and js files as routes

I'm getting mad with this issue.
Basically there are some css and js files which are opened correctly from laravel. But some other js and css files are recognized as routes!
For example: http://localhost:8000/assets/ammap/themes/light.js
I'm using the following code to access assets from templates:
<script type="text/javascript" src="{!! asset("assets/ammap/themes/light.js") !!}"></script>
Obviously the path is correct and the file exists.
I've solved the problem.
I'm using OS X and it was a permission issue.
chmod -R 0777 public
Then set everyone to "Read & Write" into file permissions.

wkhtmltopdf outputs garbled text

I just installed the latest static build of wkhtmltopdf-amd64 (0.12.3). On any html page I convert to PDF, the text appears as solid squares.
Example of google's homepage as PDF:
[acoder#box bin]# ./wkhtmltopdf-amd64 http://google.com goog.pdf
Or, here's an even simpler HTML source doc:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
</head>
<body>
<p>Hello world.
<table><tr><td>I am a table</td></tr></table>
<pre>formatted</pre>
</body>
</html>
Output:
What could be causing this?
This was due to a missing dependency, urw-fonts. After that was installed, converted text is readable.
For clarity & documentation on a minimal install of EL7:
Grab the wkhtmltopdf-amd binary and unpack to a temporary location.
Install dependencies: yum install libXrender libXext fontconfig urw-fonts
Test the binary with wkhtmltopdf-amd -V - this should print the version (0.12.3 as of today).
Next test that it converts documents as expected. wkhtmltopdf-amd http://google.com googlehomepage.pdf
If the output PDF looks good, then copy the binary to /usr/bin and call it done.

Deploy Angular 2 app to Parse.com

When I run my index.html file in my (typescript) Angular 2 app which is also a Parse.com app (It has the cloud and public, parse.local and parse.project directories etc) it runs fine. But when I try to deploy it to Parse.com it doesn't deploy.
A lot of errors show in the terminal saying Bad file name for the files in the node_modules folder.
Is my node modules folder in the wrong directory? Or do I need to get rid of all of the files that have a bad file name according to parse.com?
Here is my project file structure:
Here is a sample of the error log in the terminal after typing parse deploy from the root directory of my project - The actual error log is too big to paste the whole thing. Notice that it says
Open file xxx - too many open files
open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/define-property.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/event-target.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/file-reader.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/functions.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/geolocation.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/mutation-observer.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/promise.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/property-descriptor.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/register-element.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/websocket.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/utils.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/zone.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/zones/long-stack-trace.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/package.json:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/package.json: too
many open files | open
/Users/Ben/development/whatwegrowangular2/public/tsconfig.json: too
many open files
Here is another sample of a different error from the same terminal:
Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js
| Bad file name:
node_modules/ua-parser-js/test/browser&mediaplayer-test.json Will
retry in 1 seconds
EDIT: I moved the node modules that were actually used out of the node_modules folder and deleted the node_modules folder. The index.html file still runs and looks fine. But when I try to deploy to parse.com, I get this error now:
Finished uploading files Deploy failed with error: You have 3029
hosted files but are limited to 500 Will retry in 0 seconds.
I have to load all node_modules via a CDN script tag in my html file, not by having the actual node_module files in my project.
At this stage I have these two script tags and it kinda works (All that is on the page is an angular 2 component which has a bootstrap danger button - It works fine it just loads kinda slow):
<script src="https://code.angularjs.org/2.0.0-alpha.47/angular2.dev.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.18.4/system-csp-production.js"></script>
I get these errors in the console:
Uncaught ReferenceError: System is not defined bootstrap.min.js:6
Uncaught Error: Bootstrap's JavaScript requires jQuery bundle.js:27364
Angular 2 is running in the development mode. Call enableProdMode() to
enable the production mode. angular2.dev.js:138
http://whatwegrowangular2.parseapp.com/app/bundle.js did not call
System.register or AMD define Error loading
http://whatwegrowangular2.parseapp.com/app/bundle.js
Please comment with any other cdn script tags to include in my index.html file to get rid of all errors. Thanks.
Here is my full index.html file:
<html>
<head>
<title>Angular 2 QuickStart</title>
<!-- 1. Load libraries -->
<script src="https://code.angularjs.org/2.0.0-alpha.47/angular2.dev.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.18.4/system-csp-production.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<!-- 2. Configure SystemJS -->
<script>
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('app/bundle')
.then(null, console.error.bind(console));
</script>
</head>
<!-- 3. Display the application -->
<body>
<my-app>Loading...</my-app>
</body>
</html>

QUnit and Sinon.js under continous integration

I am using QUnit+Sinon.js which works well natively.
The problem was occured when I tried to build it into a continous integration process.
I am using js-test-driver framework to be able to run it in continous integration enviroment.
In the past I used it without Sinon.js and it wasn't any problem with that.
But after I included the Sinon.js plugin, it doesn't work at all.
When I tried to run my tests it says:
D:/my/project/url/contentTest.js:60: TypeError: qTest is not a function
Total 0 tests (Passed: 0 Fails: 0 Errors: 0)(0.00 ms)
My js-test-driver configuration:
server: http://localhost:9879
load:
# QUnit related files
- qunit/lib/equiv.js
- qunit/lib/QUnitAdapter.js
- qunit/plugin/sinon-1.6.0.js
- qunit/plugin/sinon-qunit-1.0.0.js
# Dependencies
- external/jquery/1.7.2/jquery.min.js
# Files under test
- content.js
# Tests
- contentTest.js
The interesting thing is that there is a QUnit index.html file which works well (when I open this html, every tests passes):
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>my tests</title>
<link rel="stylesheet" href="./qunit/lib/qunit-1.11.0.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<!-- core -->
<script src="./qunit/lib/qunit-1.11.0.js"></script>
<script src="./qunit/plugin/sinon-1.6.0.js"></script>
<script src="./qunit/plugin/sinon-qunit-1.0.0.js"></script>
<!-- dependencies -->
<script src="./external/jquery/1.7.2/jquery.min.js"></script>
<!-- under test -->
<script src="./content.js"></script>
<!-- tests -->
<script src="./contentTest.js"></script>
</body>
</html>
So it seems there is a conflict with js-test-driver and Sinon.js. If I remove all related Sinon.js tests and the included sinon plugins, then it works.
If I just remove the sinon related tests, it still failes.
If I don't remove sinon.js but remove all tests and create an emty test with an "ok(true)" assert, then it still fails with the same error message (contentTest.js:60: TypeError: qTest is not a function), however my test file is consists just 10 row (how it could be an error in 60.th line when my file consists only 10 line?).
Thank you all for any helps in advance!
Not a solution, but perhaps an approach to get more information: can you run the js-test-driver scripts locally from a shell? Does it produce similar error details? At the very least, this will give you more information and a shorter feedback loop.

LInking to CSS from Module CodeIgniter

So I have a module setup and working, and have setup an asset folder within it containing a css and js folder. My files are in there, but when I try linking to them like this:
<script type="text/javascript" src=/application/modules/badge_progress/assets/js/jquery.jcarousel.js"></script>
Or this:
<script type="text/javascript" src=<?php echo base_url(); ?>/application/modules/badge_progress/assets/js/jquery.jcarousel.js"></script>
They don't work. What is the proper way to link to the files?
You have a problem with your quotation marks. The src value starts with no quotation mark but ends with one. Try
<script type="text/javascript" src="<?php echo base_url();?>/application/modules/badge_progress/assets/js/jquery.jcarousel.js"></script>`
You cant access directly from /application folder from web browser.
Move badge_progress folder with same directory with application and try this
<script type="text/javascript" src="<? echo base_url();?>badge_progress/assets/js/jquery.jcarousel.js"></script>
keep your js and css file in root folder and try and check in firebug js file and css file is loading or not and what path is created for that file and then fix it.

Resources