Running JSLinux in Rhino - rhino

For the fun of it, I tried running JSLinux in Rhino using envjs and it doesn't seem to throw any errors, nor does it seem to work.
As mentioned here: How do I locally host the webbrowser Virtual Machine here: http://bellard.org/jslinux/, I first downloaded all the files and ensured that it opens up fine in a browser. Then I got to trying it out in rhino.
Here is the interaction:
$ rhino
Rhino 1.7 release 2 2010 01 20
js> load('env.js')
[ Envjs/1.6 (Rhino; U; Linux i386 2.6.32-31-generic-pae; en-US; rv:1.7.0.rc2) Resig/20070309 PilotFish/1.2.13 ]
js> window.location = 'emul.html';
There is some high CPU usage and then it seems to be doing nothing.
Is there some way to get it to work?

I think Rhino does not support Typed Arrays, which is required for jslinux to run.

"I first downloaded all the files and
ensured that it opens up fine in a
browser. "
Did it work? I did this too, but Chrome said :
Cross origin requests are only
supported for HTTP.
then I copy the files to my Apache www folder, and view it with localhost, it finally works.
So I think that you may have to modify the JS file with the Ajax part(it use Ajax to load 3 files like vmlinux26.bin etc)

Related

CSS not rendering at puppeteer inside docker

I have automated browser tests using puppeteer. I ran them at Circle CI using default Circle CI windows machine. Now I'm trying to change to a docker which is based on a Microsoft Debian machine (the website is .NET). I installed chromium at this machine. The problem is the CSS is not rendered. I used page.on request/response and the css is requested, response is 200. I looked for a configuration that could be disabled, but I didn't find it - neither at StackOverflow.
Repository: https://github.com/darakeon/dfm/
Branch right now: 4.1.5.0 (it will be promoted to master when I finish the version)
The dockerfile is inside docker folder. It is at Docker Hub too, my user is darakeon. Right now the name is darakeon/net-circleci. When I solve the problem, I will rename this, to split into 2 different machines - one based on microsoft which has only libman, another based on the first, that can run puppeteer too.
Tests folder: site/Tests/Browser
Script I'm using to run tests: .circleci/browser/run-tests.sh
The most time you spent trying to solve something, the more ridiculous will be the solution. Please, call me idiot, but help me to solve this...
Discovered the problem. Here is how:
I used page.screenshot at another site on the web to check if the css was rendering at it. It was. Weird. After looking for solutions, I was always finding people teaching how to NOT show the css, intercepting the request and stopping it. So I intercepted the requests to see if the css was being requested:
await page.setRequestInterception(true);
page.on('request', (req) => {
console.log(req.url(), req.resourceType())
req.continue();
})
Given the requests were ok, I went to check the responses:
page.on('response', (r) => {
if (r.status() >= 400)
console.error(r.url(), r.status())
})
Surprise! My main css was returning 404. But why, if it worked at windows? Simple. Windows doesn't care if you call Bootstrap, bootstrap, bOOTSTRAP or BoOtStRap, them all will search the same file. Linux consider as right just the exactly same case.
So, when you get your .NET site from windows and put it at Linux, check the cases of everything.

viewing a X3DOM file locally

I am running Linux Mint 17.1 (Rebecca)
on my Dell 4x Intel(R) Core(TM) i3-5005U CPU.
I have done X3D in a viewer in the past, but am now
try to do X3DOM in a Google Chrome v42 browser.
I can, for example display
examples.x3dom.org/example/x3dom_helloWorld.xhtml
from x3dom.org website. But when I copy locally to my machine
and try to view I get
"XMLHttpRequest cannot load file:///home/andrewmneiderer/src/Web3D/X3DOM/x3dom.swf. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource."
Has anyone seen this error and have suggestions on what to do?
I wonder why this is not stated in the current documentation, but I remembered that I read it. You can find it in the documentation of previous versions http://x3dom.org/download/1.5.1/docs/html/notes/platforms.html#chrome
Recent releases of Chrome require you to enable WebGL. Please use the
following command parameters when launching chrome:
--enable-webgl
--use-gl=desktop
--log-level=0
--allow-file-access-from-files
--allow-file-access
The last two options enable the browser to load textures from disk. You will need this if you are developing your site
locally.
Furthermore there is an option --disable-web-security which has been mentioned here: http://x3dom.org/docs-old/notes/cors.html#chrome
Besides from that, I think you should try to get a machine with native WebGL support since this Flash version of X3DOM is just a fallback method which might lack the performance features of the native version.
Chrome on all systems (by default) does not enable loading of resources from the local disk - even when the parent HTML comes from the local disk. Firefox, IE, and (I think) Safari all allow local file loading. If you need to load X3D files using X3D from your local disk, then you need to implement a local web server. It is not necessary to run a full-blown Apache server. Google 'local web server' for various options.

MVC3 using Open Office to convert Docx to PDF Issue

Newbie to site and MVC/.net web development.
I have searched hi and low and although there are some threads about this issue, I cannot seem to get a solution/direct answer ... hopefully someone here can assist.
I am using VS2010/MVC3/C#/.Net4/IIS7 to develop an internet app. making use of Open Office 3.4.1 to create PDF's from Docx documents.
I used this approach: http://tinyway.wordpress.com/2011/03/30/how-to-convert-office-documents-to-pdf-using-open-office-in-c/
All works fine on my local development machine, however as soon as I publish on the test server ... the bootstrap call (line 10) does not return (simply hangs for lack of better description)
Hopefully someone here can help.
Thanks, Eugene
I guess you have installed Open Office on your development machine. You have to do the same on your web server making sure you're using the same Open Office version.
Your application must reference these assemblies:
cli_basetypes.dll
cli_cppuhelper.dll
cli_oootypes.dll
cli_ure.dll
cli_uretypes.dll
and they all have to be set "Copy Local" to false.
You won't deploy these dlls cause they're going to be loaded from the GAC.
If your IIS is running on a x64 OS you might need to:
"Enable 32-Bit Applications" = True
This article might help you.
If you want to dig deeper.

ZF2 Fatal error: Class 'Locale' not found in /home/...../Zend/I18n/Translator/Translator.php on line 228

I have a project in my localhost, already running, after modifying the php.ini of my XAMPP server [running on Windows 7] (adding: extension=php-intl.dll).
But when i upload this project to my GoDaddy hosting, it doesn´t works and get the following error:
Fatal error: Class 'Locale' not found in /home/content/41/9674641/html/library/zend.2.0.4/Zend/I18n/Translator/Translator.php on line 228
GoDaddy hosting details:
Php version 5.3
Operating system: Linux
i386-redhat-linux-gnu
Zend Framework details:
Zend Library: 2.0.4
I´ve tried what they say on the following links:
http://support.godaddy.com/help/article/1085/can-i-add-a-php-initialization-file-to-my-hosting-account?locale=en
http://support.godaddy.com/help/article/5647/why-isnt-my-phpini-file-taking-effect?locale=en&ci=46061
Also, i´ve called to 24/7 goDaddy support and they suggested me to create a php5.ini file in the root directory, then, they told me to stop all web services (Cpanel/Stats & Monitors/System Processes/end web), but they didn´t told me what do i need to include in the php5.ini file.
I was reading some links and, as my localhost is a windows one, adding the extension=php-intl.dll to the php.ini file worked. So i´ve tried to include in my godaddy linux server: extension=php-intl.so but doesn´t works (neither extension=php-intl.dll).
The problem with the goDaddy hosting began when i started using ZF2 FORMs.
Updates:
1) I´ve got access to the php5.ini of the goDaddy server (i have made a copy on the root of my hosting) using PUTTY: cp /web/conf/php5.ini /var/chroot/home/content/41/9674641/html
Then i have read it and i could not find the "intl" extension, instead of this, i only could find:
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
;extension=php_mbstring.dll
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
;extension=php_mysql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
2) goDaddy response to my formal support request (ticket):
Thank you for contacting Online Support
I understand you are wanting to get Internationalization extension on
to your hosting account. At this time these are not supported in our
systems at this time. We are going to review this with our developers
to more information. You may receive an email us down the road with
addition information about this.
Please let us know if we can assist you in any other way.
Now i'm thinking that i have two problems:
A) Include the line to enable the extension (i don't know how):
Maybe could be:
extension_dir=/var/chroot/home/content/41/9674641/html/library/extensions/php-intl/usr/lib64/php/modules
extension="intl.so"
B) Include the extension in some location inside my hosting (but i don´t know how):
Maybe i could put the extension files inside: /var/chroot/home/content/41/9674641/html/library/extensions/php-intl
Also, i don't know where to acquire the extension files
C) Is there any known update on ZF2 (skeleton, library ..) that solve this issue ?
Please, i need help as soon as possible.
You can manage PHP modules by using the "Change PHP version" feature of the cPanel interface. Select any version other than "native" and a list of checkboxes will appear.
http://support.godaddy.com/help/article/3937/viewing-or-changing-your-php-language-version?pc_split_value=2
Of course, their support might not immediately mention this solution, which should have been in their knowledge base in the first place.

How can I start a web browser and open a certain web page from Erlang on Windows in IE?

I have an erlang program which runs a server on a local machine and I would like it to start a local web browser and point to itself on startup. How can I do this in a portable way across Windows XP. Vista, and Windows 7?
I would suggest to use the following code on windows systems:
URL = "http://www.google.com/", os:cmd("start " ++ URL).
This has two advantages:
1) No need for the right path of the
browser.
2) Works even if someone doesn't use
IE.
Too bad I don't know of something similar on Linux or MacOS.
URL = "http://www.google.com", os:cmd("\"C:\Program Files\Internet Explorer\iexplore.exe\"" ++ URL).
You might have to modify the path if IE isn't located in that folder.
You can use the port api in erlang to start a normal command.
For open a browser you have multiple options:
Look to the IExplorer.exe or how its called and start it with the URL as a parameter
Use the rundll32.exe command to open a browser through the windows api. I guess this will use the configured browser, so this is recommended.

Resources