P5JS instance mode with sound library is throwing error - processing

Here is my codepen. I was trying to write simple music player using instance mode in p5js but sound extension of p5js causing problems. I don't know how to fix it. Is it a bug in the latest version of p5js?
Also, my devtool is keep freezing when I use p5js library. ]
Below is the error I get when I include sound lib in instance mode.
p5.min.js:3 Uncaught (in promise) TypeError: this._userNode.appendChild is not a function
at _.l.default.createCanvas (p5.min.js:3)
at _setup (p5.min.js:3)
at _runIfPreloadsAreDone (p5.min.js:3)
at _decrementPreload (p5.min.js:3)
at _.<anonymous> (p5.sound.min.js:2)
here is my codepen

Related

Web application written with Processing, using processing.js: how to debug?

I'm a newby in HTML, while I've some skill with Processing language.
I'm writing an application in Processing which I want to visualise in a local webpage.
I've a basic index.html, which upload my sketch and the file processing.js.
It works.
My problem is that sometimes, an application which runs with no proiblem using the Processing IDE, does not run in the webpage. I assume there are still some bugs in the porting from Processing to JavaScript.
What I would like to know is: is there some way to debug the webpage I try to visualise?
Just to seek "where" the webpage remains stuck! In this way I could bypass the problem!
For now, I'm using Firefox for html visualisation.
Thanks a lot, Valerio
Ops solved! I downloaded FireBug, an add-on for Firefox implementing a debugger.
Then I launched the debugger. It showed me immediately the error.
For curious people:
I declared an ArrayList called "foo_list", containing object "foo":
ArrayList<foo>foo_list
The above line does not produce any error in the Processing IDE.
However processing.js complains with it, the debugger displayng
the following message:
ReferenceError: ArrayListfoo_list" is not defined
The solution is to insert a blank space:
ArrayList<foo> foo_list;
This works! Maybe the error given to the parser
from Processing to JavaScript!
Bye!

Firefox Annotator SDK tutorial, cannot get the annotator button to work

Link to the tutorial
I am trying to get to grips with Firefox SDK development using the tutorials on MDN. The annotator tutorials seem very good but CFX Run fails on the first control stage.
The tutorial uses the widget API that was deprecated in Firefox 29 but I tried downgrading Firefox 28 and the tutorial still doesn't work even when I am copy and pasting the code directly from the page code. When I come to the end of the Implementing the widget page I only get the following message when trying to click the widget icon (the first time, then nothing hapens).
(C:\Users\myname\Firefoxplayground\addon-sdk-1.16) C:\Users\myname\Firefoxplay
ground\pageMod>cfx run
Using binary at 'C:\Program Files (x86)\Mozilla Firefox\firefox.exe'.
Using profile at 'c:\users\sigvard\appdata\local\temp\tmpg3kq0j.mozrunner'.
console.error: pagemod:
Error opening input stream (invalid filename?)
JavaScript strict warning: chrome://browser/content/urlbarBindings.xml, line 666
: reference to undefined property this._value
JavaScript error: chrome://browser/content/urlbarBindings.xml, line 648: aUrl is
undefined
The issue was caused by a bug in the Firefox SDK.
Updating to Firefox SDK 1.16 and initializing a new folder for the project solved it.

javascript not throwing ReferenceError when using events

UPDATE: This issue cannot be reproduced in Chromium. It seems to be specific to Firefox (both developer toolbar and Firebug).
I have tried disabling all add-ons but still can't get the errors to fire. RUnning Firefox 24.1.1 (mozilla tells me I am using the latest version. This behaviour has been consistent across updates.
I am really new to using events in javascript so hopefully this is an easy fix. But I couldn't sift through all the "error handling" articles when I search for "javascript custom event handler no errors"
When I execute the following code with a syntax error ("consle.log"; no "o"), it fails without throwing any syntax errors
function greetHandler(){
consle.log("Hey bro");
}
document.addEventListener("greet", greetHandler,false);
document.dispatchEvent(new Event('greet'));
However, if I were to use run only:
consle.log("Hey bro");
The console would loudly complain:
ReferenceError: consle is not defined
How can I get that ReferenceError throwing when I am using eventListeners to make my debugging life easier?

Firefox add-on builder and Jquery Mobile

I am trying everything under my power here to insert jquerymobile.1.0.1 into an extension I have build for firefox.
I can install, link to any other script and everything seems to work just fine, but have had an assortment of errors getting jquerymobile to work.
I've tried uploading through the add-on builder
I've tried remotely linking the file
I've tried copying and pasting the file into other code.. nothing works.
I've coded this extension for safari, chrome and opera without issue, but Firefox chokes the second I link to/include jquerymobile in my code returning this error:
Timestamp: 12-04-27 12:10:33 PM
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHistory.replaceState]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource://jid0-d4zlaxz3cfuahkcdoecsmya637m-at-jetpack/idesireit/data/js/jquery.mobile-1.0.1.min.js :: :: line 72" data: no]
and also an error about "unallowed unicode" which I didn't get the chance to copy or paste, but I haven't seen that one in a few saves...
I've read that the above error can be caused by cross domain functions, but all my cross domain functions are in another js file, and they are all working just fine ( judging by those I can navigate to with jquerymobile acting as it is right now )
I'm a novice - if my error is based on my stupidity, please go lightly :O
I went ahead and created an all new extension,
included nothing but the popup, and in that pop up, called jquery and jquery.mobile.
I got this error instantly again.
I'm just going to go ahead and use the alternative UI I'm using on the dashboard widget, I've wasted too much time on this.
The bug is in the addonsdk, not in JQ Mobile. Any attempt to access or manipulate the window.history object in a panel will raise this error.

How to render with yafaray on mac osx

I've installed wings 3d on mac osx and I'm loving it. The problem is I can't do any fancy renderings. I've downloaded and installed YafaRay-0.1.0.305-OSXintel10.5 and I can't seem to get it to work.
The wings3d manual states that on mac os you export the xml file from wings 3d, but you make the rendering from Terminal, calling yafaray with the path to the generated xml as an argument.
I expected to find yafray or yafaray using locate, but I couldn't. I found yafaray-xml in /usr/local/bin
Just for testing I exported a cube in a file called box.xml
Initally I got a loads of scene tag related errors:
warning: expected </scene> tag!
Bus error
Then I removed the tag from the xml and tried again, and I got
?m?setting up scene...specify a camera!!
Anyone know how to render with yafaray from terminal on macosx ? Or how to setup a ray tracer for wings 3d on mac osx ?
Got it working now!
yafaray is a rewritten version of yafray and the xml structure is different, so wings3d is outputting the wrong xml.
I found an xml structure that worked here. I just adapted the mesh node to one of my own meshes and I got a render from terminal.
Also if anyone is interested in the official specs here they are.
The handy user guide can be found here.
I tried using blender and blender 248.1 keeps crashing when I select the yafaray xml script from the render menu. blender 245.15 on the other hand crashed a few times first, but now I can render without any crashes. The only glitch is that after each render the ui freezez, so I need to CMD+Tab to another app and back to get around that.
Hope this might help anyone else having similar issues.

Resources