Overtone & Vim (Repl doesn't seems to be connected) - vim

I tried to play with overtone on ubuntu, but I can't eval some of overtone's codes in Vim.
:Eval works for the clojure code; I tried it in vim (a clj file in the lein project directory), ex: (+ 1 2 3) => :Eval => appeared on the bottom of the vim window => 6, so it's ok.
But, for example, I tried:
(demo(sin-osc)) => :Eval ;(:Require don't change nothing)
It returned:
java.lang.RuntimeException: Unable to resolve symbol: demo in this context, comp
iling:(NO_SOURCE_PATH:1:1)
So here's what I do:
jack is started
lein repl is started in the lein project (deps is ok)
in the first terminal where there is lein I start overtone (use 'overtone.live), here is the log; I've got 2 errors:
user=> (use 'overtone.live)
--> Loading Overtone...
--> Booting internal SuperCollider server...
* ERROR: dlsym load err '/home/axxon/workspace/overtone/tutorial/native/linux/x86_64/libscsynth.so: undefined symbol: load'
Found 10 LADSPA plugins
* ERROR: open directory failed '/home/axxon/.local/share/SuperCollider/synthdefs'
JackDriver: client name is 'SuperCollider'
SC_AudioDriver: sample rate = 44100,000000, driver's block size = 1024
--> Connecting to internal SuperCollider server...
--> Connection established
JackDriver: max output latency 23,2 ms
here, in this window I tried (demo(sin-osc)). it works; I can hear it.
Great, but now I want to script with Vim, so I created a new file (mytest.clj) in the lein project directory (/overtone/tutorial), I opened it with Vim (in another window)
in this blank file, I wrote the same thing as I said before, (demo(sin-osc)) and tried to eval with first, :Require, it returned this:
(clojure.core/require 'user :reload)
java.io.FileNotFoundException: Could not locate user__init.class or user.clj on
classpath:
with Eval, it doesn't work either.
Thanks for your help because I really want to use overtone!
Ps: my vim bundles:
Bundle 'guns/vim-clojure-static'
Bundle 'tpope/vim-fireplace'
Bundle 'tpope/vim-classpath'
Edit: I forgot to use a correct namespace, and in overtone's google group, i seen that mytest.clj must be in the src directory of the project. I tried this code with :Require (i stopped overtone in the first window where i started lein):
(ns tutorial.foo
(:use [overtone.live]))
(definst saw-wave [freq 440 attack 0.01 sustain 0.4 release 0.1 vol 0.4]
(* (env-gen (lin-env attack sustain release) 1 1 0 1 FREE) (saw freq) vol))
(saw-wave)
, but it returned:
(clojure.core/require 'tutorial.foo :reload)
Erreur détectée en traitant function <SNR>17_Require..fireplace#session_eval..<S
NR>17_eval..7 :
ligne 38 :
E605: Exception non interceptée : Error running Clojure: *** ERROR: open directo
ry failed '/usr/java/packages/lib/amd64'^#*** ERROR: dlsym load err '/usr/lib/jn
i/libswt-gtk-3836.so: undefined symbol: load'^#*** ERROR: dlsym load err '/usr/l
ib/jni/libswt-glx-gtk-3836.so: undefined symbol: load'^#*** ERROR: dlsym load er
r '/usr/lib/jni/libswt-webkit-gtk-3836.so: undefined symbol: load'^#*** ERROR: d
lsym load err '/usr/lib/jni/libswt-atk-gtk-3836.so: undefined symbol: load'^#***
ERROR: dlsym load err '/usr/lib/jni/libswt-pi-gtk-3836.so: undefined symbol: lo
ad'^#*** ERROR: dlsym load err '/usr/lib/jni/libswt-cairo-gtk-3836.so: undefined
symbol: load'^#*** ERROR: dlsym load err '/usr/lib/jni/libswt-awt-gtk-3836.so:
undefined symbol: load'^#*** ERROR: dlsym load err '/usr/lib/jni/libswt-gnome-gt
k-3836.so: undefined symbol: load'^##^## A fatal error has been detected by the
Java Runtime Environment:^##^## SIGSEGV (0xb) at pc=0x00007f5d261db671, pid=693
1, tid=140036632291072^##^## JRE version: 7.0_25-b30^## Java VM: OpenJDK 64-Bi

I was having the same problem. It turned out that the vim fireplace plugin was not connected to my bash repl session. I manually established the connection and everything worked just fine afterwards.
At the top of your lein session you should see the details about what port the repl session is running on
nREPL server started on port 35182 on host 127.0.0.1
So then you can connect vim-fireplace to that repl session by using
:Connect nrepl://localhost:35182
The reason why you can still evaluate code like (+ 1 2 3) even when vim-fireplace is not connected to the remote repl session is because vim-classpath will make it fall back to just spawning a new clojure runtime instance to evaluate that code. Once the fireplace repl connection is working you should notice that evaluating code becomes a lot faster since it doesn't need to load clojure from scratch.

Make sure that you use overtone.live in the namespace declaration of the file you are editing in vim, and that the REPL is running in a separate terminal instance. From vim, save the file (:w) and move your cursor into the ns declaration. Then hit gf to open the file for the namespace. Type cpR or :Require! and then cpp or :Eval the function you were trying to run. Hopefully this will work for you! Best of luck.

Related

EclipseCDT will not debug executable: Error creating process

I just installed EclipseCDT 2022-12, created the HelloWorld example app, compiled, but when I debug I get an error. I have both current MSYS2 (MinGW64) and Cygwin64 installed, neither environment works and fails with the same error:
Error in final launch sequence:
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Error creating process /cygdrive/c/Windows/system32/C:/Projects/cc3135/hello/C:/Projects/cc3135/hello/Debug/hello.exe, (error 2).
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Error creating process /cygdrive/c/Windows/system32/C:/Projects/cc3135/hello/C:/Projects/cc3135/hello/Debug/hello.exe, (error 2).
Error creating process /cygdrive/c/Windows/system32/C:/Projects/cc3135/hello/C:/Projects/cc3135/hello/Debug/hello.exe, (error 2).
Any suggestions?
P.S. The hello executable runs fine in cmd.exe and under gdb.

GameRanger issue on linux mint

I would like to play AOM on gameranger on my linux mint 17.3 rosa.
I can play AOM with wine but i cant open gameranger. everytime I try this error pops up:
gameranger has encountered an unexpected error and must quit.
this error has been logged automatically.
this should be the log:
p11-kit: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: impossibile aprire il file oggetto condiviso: File o directory non esistente
err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
fixme:systray:wine_notify_icon unhandled tray message: 4
fixme:iphlpapi:NotifyAddrChange (Handle 0x41be570, overlapped 0x3ff4f54): stub
fixme:winsock:WSALookupServiceBeginW (0x41be670 0x00000ff0 0x41be6b8) Stub!
[0512/164500:ERROR:network_change_notifier_win.cc(143)] WSALookupServiceBegin failed with: 8
wine: Call from 0x7b83aace to unimplemented function dnsapi.dll.DnsFlushResolverCacheEntry_A, aborting
I've wandered around the internet, trying this trying that. Nothing works.
https://appdb.winehq.org/objectManager.php?sClass=version&iId=20206
here is the solution, look down the page.

banquo/phantom nodejs error - Cannot read property 'createPage' of undefined

im trying to run https://github.com/ajam/banquo-server and receiving and error
Cannot read property 'createPage' of undefined
Express server listening on port 3000
Requesting http://america.aljazeera.com
/root/banquo-server/node_modules/banquo/src/banquo.js:36
ph.createPage(openPage);
^
TypeError: Cannot read property 'createPage' of undefined
at createPage (/root/banquo-server/node_modules/banquo/src/banquo.js:36:7)
at /root/banquo-server/node_modules/node-phantom/node-phantom.js:65:6
at null._onTimeout (/root/banquo-server/node_modules/node-phantom/node-phantom.js:43:5)
at Timer.listOnTimeout (timers.js:110:15)
error: Forever detected script exited with code: 1
error: Script restart attempt #7
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
I have checked and an error is being returned from node-phantom.js:36 but does not specify what.
any ideas?
regards
I've had the same issue and fixed it adding the phantomjs binary to PATH.
You can test if it is already set running the command:
$ phantomjs
The following error means that it isn't:
'phantomjs' is not recognized as an internal or external command, operable program or batch file
As you said in a comment:
not a bug as this works on my local mac, not on external server
So, that's not a problem with your code. That's a problem with your environment so I guess that you also missed to set the PATH variable.

Install OpenCV-2.4.9 on CentOS 7 (PC)

I'm trying to install OpenCV-2.4.9 on CentOS 7 (PC) however getting error after 16% when running "make" command. I leave default configuration for OpenCV.
make
...
[ 16%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_v4l.cpp.o /opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:306:29: error: field ‘capability’ has incomplete type
struct video_capability capability;
^ /opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:307:29: error: field ‘captureWindow’ has incomplete type
struct video_window captureWindow;
....
....
/opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp: In function ‘void icvCloseCAM_V4L(CvCaptureCAM_V4L*)’:
/opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:2812:46: error: ‘CvCaptureCAM_V4L’ has no member named ‘memoryBuffer’
It seems that the define HAVE_CAMV4L has the value 1, if you look in the file modules/highgui/src/cap_v4l.cpp looking for the structure definition at the row 306. If the compilation fails at that point this means that the video4linux development configuration is corrupted.
Using google I have found that the OpenCV Bug #1357 is described as follow:
CHECK_INCLUDE_FILE(linux/videodev.h HAVE_CAMV4L) succeeds even though linux/videodev.h doesn't exist on the system. (Bug #1357)
http://code.opencv.org/issues/1357
Anyway the solution is described at the same URL for "HAVE_CAMV4L gets set incorrectly": "Setting it to FALSE in CMakeLists.txt fixes the problem".

heimcontrol.js Node/Mongodb: 'events.js:2817: Uncaught Error: Cannot open /dev/'

I have been struggling for a week trying to figure out what went wrong. I had this running fine from outside my house and controlling an led on a breadboard. When I restarted my pi and attempted to run 'node heimcontrol.js', I am greeted with 'info - socket.io started' (expected), and two instances of 'events.js:2817: Uncaught Error: Cannot open /dev/' and no return of listening on port. I've checked and changed my permissions of /dev/ to 'drwxr-xr-x 12 pi root 3100 Sep 28 15:58 dev'. I know 777 isn't the best practice, but I was trying to see if that was the issue. I've tried to locate the events.js to dig deeper, but no luck. What should I check next? I've run out of ideas.
node v0.10.2
mongo v2.1.1
pi#raspberrypi ~/heimcontrol.js $ node heimcontrol.js
info - socket.io started
events.js:2817: Uncaught Error: Cannot open /dev/
events.js:2817: Uncaught Error: Cannot open /dev/
Thank you very much in advance.
Edit 01: I pointed my Pi browser to 127.0.0.1:8080 and was greeted with a page 'Motion 3.2.12 Running [1] Threads' and a hyperlink 'All' which leads to settings. I am assuming that I created a video module in Heimcontrol and did not finish the setup since Motion detect my camera (RPi camera module). Not familiar with Motion, maybe someone can help guide me.

Resources