Can't import ControlP5 in Processing.js - import

import controlP5.*;
ControlP5 gui;
void setup()
{
gui = new ControlP5(this);
}
The previous code, when run in Processing.js gave the error: "Uncaught Processing.js: Unable to execute pjs sketch: ReferenceError: ControlP5 is not defined" even though ControlP5 is installed on my computer. Can anyone please help me to make this problem go away so that I can use ControlP5 in Processing.js?

Processingjs provides a javascript 'virtual machine' to run the core processing api. controlp5 is a processing library written in java. Therefore, you would need a version of this library written in javascript.
There was some discussion of a port a while back, follow up with this thread:
https://groups.google.com/forum/#!topic/processingjs/dfzwPQ4Wqus
See this post for more information on libraries which have been ported:
What is the processing libraries processing.js can execute?

Related

A constructor from a node module I'm importing works when using Create React App, but errors in ParcelJS. What is going on?

I'm converting a project that was built using Create React App to use ParcelJS as a bundler instead. Strangely, a dependency that I imported during development (#twilio/voice-sdk) works fine in the CRA version of the application, but I get the following error when I try to invoke the constructor in the Parcel version:
TypeError: (this._options.AudioHelper || audiohelper_1.default) is not a constructor
The package is identical between both (#v2.1.1, the latest). I'm importing using ESM syntax, so:
import { Device } from '#twilio/voice-sdk'
I trying using CommonJS syntax (require) and it still didn't work. I've dug into the compiled code, and that seems to be the issue. I imagine there are a lot of differences, but one that I've noticed is here:
On the left is the code compiled by Create React App, which does seem to be exporting something more substantial than on the left - is the export just an empty object? If so, it's no wonder I'm getting a constructor error.
Unfortunately, no amount of googling and SO sleuthing has clarified what I could do to make ParcelJS transpile this dependency properly, if that's the issue. I've tried to make the babel config for ParcelJS match CRA more closely by adding the following to a babel.config.json
{
"plugins": [
"#babel/plugin-transform-modules-commonjs"
]
}
But no luck. Any ideas from where to go from here, or is it time to switch to Webpack?
It looks like Twilio package has a problem when using Parcel 2: https://github.com/twilio/twilio-voice.js/issues/101

Unable to import Actor from cell.actors

from cell.actors import Actor
The above import produces an unresolved error in major IDEs like Pycharm.
Tried looking everywhere in the documentation of Celery/cell. The exact problem when ran in terminal looks as follows:
ImportError: cannot import name 'ipublish' from 'kombu.common'
As explained on their website, Cell is an actor framework for Kombu, a messaging library for Python.
I checked everywhere in source files cell/actors.py and kombu/common.py for the error and the files seemed to be correct and no error in code. Therefore, there must be some environmental mismatch problem.
Found a solution to the problem partially. Installing specifically python3.7.0 is making the unresolved reference errors go away in the IDE, but still unable to create Actor and import 'dAgent'. Looked into source files and 'dAgent' must have been changed to 'Agent' class.
Still, no resolution for this error, although importing these objects from source files and providing the same inputs solves the unresolved reference error. But, the main error from kombu still exists.

Trying to run basic Flutter demo project, but I keep getting a weird error

I've been trying to run Flutter's basic demo project in VS Code, but I'm having some trouble. I keep getting this error:
java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module #0x1b1c397f) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module #0x1b1c397f
And I honestly have no idea what it means or how to even start fixing it. Any guidance would be appreciated! Thanks so much in advance.

Building Apple Swift on ppc64le for ubuntu 16.04

We are trying to build Apple Swift on ppc64le Ubuntu16.04. We built it on ppc64le using a build script at the following link:- https://github.com/ppc64le/build-scripts/blob/60b7885f4f0915a8671b3cfb86ddbb65f9b988a8/swift/swift41_ubuntu_16.04.sh
With this we were able to run the 'swiftc' and REPL environment for some basic "Hello World" type of code. However for complex codes, like import Foundation, it fails(probably due to Package manager issues). When we use "import Foundation" with swift, compile error occurs as below is seen:
(swift) import Foundation
<REPL Input>:1:8: error: no such module 'Foundation'
import Foundation
^
We are trying to build Swift 4.2(since Swift v4.1 has been released now and no further development is happening on this branch.) on Power8/LE (ppc64le) using the build-toolchain, in order to build the Swift package manager and other tools.
We are seeing a crash which is traceable till following function in HeapObject.cpp file:
static HeapObject *_swift_retain_(HeapObject *object) {
SWIFT_RT_TRACK_INVOCATION(object, swift_retain);
if (isValidPointerForNativeRetain(object))
object->refCounts.increment(1);
return object;
}
Beyond this debugging using simple print statements is tricky and the code flow is unclear. Breakpoints cannot be set since building code in debug mode is not possible as it runs out of resources and hangs. Any help here would be greatly appreciated. Any more outputs, errors can be shared.
Looking forward to port Apple Swift on Ubuntu16.04.
Regards,
Sarvesh Tamba

Trouble with require() at coffeescript

Beginer at coffeescript. I installed coffee-script and socket.io by npm. But this simple code shows me an error:
try
io = require('socket.io')
catch error
alert(error)
it returns require is no defined.
Same problem with other modules (for example fs).
Using PyCharm