Using the Boot-clj REPL to load Clojurescript functions in a Castra/Hoplon project - clojurescript

I am having quiet a bit of trouble with the boot-clj nREPL. I connect using cider-jack-in in EMACS and then at the top it displays the correct port and on the bottom it shows 'boot.user=>' but I am having trouble loading cljs functions from the '../rpc.cljs' page. In short I don't have any idea how to navigate to that place. I tired using '(load "...")' but I can't even figure out the current working directory. I couldn't find a tutorial on using the Boot REPL anywhere. I have tried it from the command line with 'boot repl' then loading with '(def p (future (boot (dev))))' but still am completely lost.
So in short, could someone help point me in the right direction? I am looking for how to change the current directory, finding the current working directory, and loading functions from a .cljs file.
:::EDIT:::
I found the boot-cljs-repl and tried to hook that up. In a Hoplon/Castra template it is already included in the 'build.boot' file but, after following the directions on their GitHub it still doesn't work. To connect it to the project add the below in the 'build.boot' file, the second part is for the Boot Task 'Dev'
(require
'[adzerk.boot-cljs-repl :refer [cljs-repl cljs-repl-env start-repl]]"
...
...
(reload)
(cljs-repl-env)
(cljs)))
...
And then, you should be able to use cider-jack-in to load the CLJS repl with the commands '(def r (future (boot (dev))))' followed by (start-repl) but whenever I run that I have an error. I have tried cider-jack-in-clojurescript and the one before but it seems to have an error connecting to the CLJS repl.
boot.user> << started Weasel server on ws://127.0.0.1:38456 >>
<< waiting for client to connect ...
java.lang.NullPointerException
at clojure.java.io$make_parents.invokeStatic(io.clj:443)
at clojure.java.io$make_parents.doInvoke(io.clj:438)
I will keep trying different approaches but so far seem stuck.
:::EDIT:::
I figured out the problem some more, if you use '(cljs-repl)' instead of '(cljs-repl-env)' than you can connect with 'cider-connect' after you start 'boot dev' in bash, and then you type '(start-repl)' into the cider repl and it starts a CLJS repl. The problem I am now having is if I try and use the REPL like a Clojure REPL it doesn't quite work. If you press C-c C-c cider just says, if in a .cljs file, that it needs a Clojurescript REPL even though it is.
Cheers,

Related

Fatal error (13): No program entry point with XDS Modula-2?

I'm using the current bundled binaries from https://github.com/excelsior-oss/xds (as of 12/6/2020) with just the most basic Hello World MOD file:
MODULE HelloWorld;
FROM STextIO IMPORT WriteLn, WriteString;
BEGIN
WriteString("Hello, World!");
WriteLn;
END HelloWorld.
xc HelloWorld.mod works fine for compiling it to object. However, I'm not clear on the exact syntax for xlink on a standalone MOD file. xlink HelloWorld.obj will at least get it to try with my object file, but as the error shows, it doesn't know the entrypoint. I've tried setting the entry point with the /ENTRY switch, but no luck doing it by module name. I've also tried setting the /SYS to console, but again, no luck there.
I feel there's some trivial linker option or program directive needed, but I'm just not finding it via Google...
To build a binary, use: xc =a =make HelloWorld.mod
The above is found in https://github.com/excelsior-oss/xds/blob/master/Sources/Doc/Comp/src/usage.tex .
It is unfortunate that XDS did not put PDFs of their documentation on github. I suggest building the documentation from their LaTeX files.
Edit: I since learnt that the Wayback Machine has archived the XDS documentation here: https://web.archive.org/web/20060705213825/http://www.excelsior-usa.com/xdsdoc.html

First time coding and confused - Echo

Apologies for incredible ignorance. First time ever looking at or trying coding in any form and all naturally a bit confusing and overwhelming.
Trying to keep it super basic I'm attempting to build something basic for Amazon Echo by working through this article - https://developer.amazon.com/blogs/post/Tx3DVGG0K0TPUGQ/updated-alexa-skills-kit-fact-template-step-by-step-guide-to-build-a-fact-skill
Have got to Step 2.3
Once you have the source downloaded [done], node installed and npm updated, you are ready to install the ASK-SDK. Install this in the same directory as your src/index.js file for your skill. Change the directory to the src directory of your skill, and then in the command line, type: npm install --save alexa-sdk
I've moved the SDK into the same folder as the source - in downloads folder. Am confused on changing the directory to the same as my skill. As far as I know there is no skill yet so not sure where to move it to.
When type in npm install --save alexa-sdk
returns
npm WARN enoent ENOENT: no such file or directory, open '/Users/OwenLee/package.json'
npm WARN OwenLee No description
npm WARN OwenLee No repository field.
npm WARN OwenLee No README data
npm WARN OwenLee No license field.
working on a mac so don't really know how/where to access this, but assuming this is where i need to move the files to?
Very sorry for baby-basic knowledge. Just trying to at least get a foot in the door as know need to learn this stuff but everything i read seems to assume i already have a working knowledge of coding : S
any help would be awesome - inc. any advice on steps after that you can probably see i'll trip up on
thanks!!
oven121
So as far as the directory /Users/OwenLee/ this would be your home folder on a Mac. The Root / of your HDD can be reached through Finder by clicking on Macintosh HD (or whatever you named your main hard drive) in the side bar. If you open up a new Terminal window it will be the directory that the terminal starts in. You should be able to fix your problem by taking the file packages.json, which should be wherever you downloaded the SDK to, and placing it in your home folder, then re-running the command.
Now don't let me change your mind if you're truly committed, but if you have absolutely no experience with programming I would recommend starting with something a bit simpler than Java or Javascript. Object oriented languages can be both very convoluted and difficult to get the hang of for beginners (I personally have been writing native languages like C for years and am just now starting to understand how Java works.).
If it is an option I recommend starting with a language that your Mac has built in support for. Perhaps start with Bash scripting or Apple Script making basic scripts to do things you find tedious to do manually in a terminal, or get to know the basics of processor-native languages like C & C++ by making some basic programmes to display text when it is run, or to ask the user to type something, and say back what they typed. Finally since you are on a Mac you can get Xcode for free in the app store, it will configure itself and you could play around with it to learn how macOS handles windows, perhaps start by making a basic programme window with a few buttons that do different things when clicked.
If you have any interest in my suggestions you can find some info about bash scripting here: https://linuxconfig.org/bash-scripting-tutorial the tutorial says it assumes the reader has no previous knowledge of Bash, and most commands should work fine in the version of Bash built into your Mac's Terminal app.
If you take more interest in C++ this is the site that I used to learn to write it, and learn how native languages work: http://www.cplusplus.com/doc/tutorial/
Finally here is a basic C++ programme called "Hello World", it is somewhat of an initiation rite of C/C++ students to write this programme and learn how each part of it works:
//HelloWorld.cpp the double slash tells the compiler and user that everything after it on this line is a comment, not code//
#include <iostream> //The octothorp '#' lets the compiler know it needs to use the library named inside the pointed brackets '</>' when it builds the programme. 'iostream' stands for In-Out Stream, and handles basic text, and basic processor commands//
using namespace std; //This line tells the compiler that any line that says to show text or ask the user to type something should use regular text and not a special format//
int main() //'int' stands for integer, any time you make a variable that contains only an integer you should put this in front of it's name, and 'main' is the name of the integer. The empty parentheses tells the compiler that this is a function, rather than a number//
{ //The open curly bracket '{' tells the compiler where the function starts
cout<<"Hello World"; //'cout' stands for 'character out' and is for showing basic text in the terminal window. The double pointy 'out' brackets '<<' tells the compiler that the text should be sent out of the programme rather than loaded into a variable, the text inside the quotes is what will be shown on the screen, and the semi colon tells the compiler where the command ends, it has to be put at the end of any command that is inside of a function//
return 0 //The command 'return' is for telling the compiler whether or not an error has occurred, 0 means the programme ran fine, 1 means something went wrong, either way the programme closes when it runs the command 'return'//
} //the closed curly bracket tells the compiler where the function ends//
Good luck with your programming, and if you have any questions unrelated to this thread please feel free to private message me, or create a new question and tag me in it so that I get notified.

Using CocoaPods with Parse is giving me error ”duplicate symbol _PFConfigParametersRESTKey"?

Currently, I am in the middle of migrating my iOS app from api.parse.com to my own server. In the guide I am following, I am at the point where I need to test the app's functionality with a local Parse Server. Although, setting up a custom Parse Server requires having the latest Parse-SDK, and I am running an older version. I am trying to update my frameworks via CocoaPods. My Podfile is as follows:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'MYAPP' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for MYAPP
pod 'ParseFacebookUtilsV4'
pod 'Parse'
#pod 'ParseTwitterUtils'
pod 'ParseCrashReporting'
pod 'ParseUI'
target 'MYAPPTests' do
inherit! :search_paths
# Pods for testing
end
end
When I try running the app, I get the following error:
duplicate symbol _PFConfigParametersRESTKey in:
/Users/ME/Library/Developer/Xcode/DerivedData/MYAPP/Build/Products/Debug-iphoneos/Parse/libParse.a(PFConfig.o)
/Users/ME/Library/Developer/Xcode/DerivedData/MYAPP/Build/Products/Debug-iphoneos/Parse/libParse.a(PFConfigController.o)
duplicate symbol _PFConfigParametersRESTKey in:
/Users/ME/Library/Developer/Xcode/DerivedData/MYAPP/Build/Products/Debug-iphoneos/Parse/libParse.a(PFConfig.o)
/Users/ME/Library/Developer/Xcode/DerivedData/MYAPP/Build/Products/Debug-iphoneos/Parse/libParse.a(PFCurrentConfigController.o)
ld: 2 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've been searching for something online to help, but nobody seems to be experiencing this problem. I think my case is unique, as I have yet to see someone who has two duplicate errors on the same symbol pointing to the same archive(libParse.a) with one shared file (PFConfig.o) and two differing ones (PFConfigController.o and PFCurrentConfigController.o). I've implemented a variety of solutions that would generally solve this "duplicate symbol" error, but I haven't had any success.
Things I have done:
Ensured that all manually added versions of these frameworks have been removed from the project.
Scanned the project directory up and down multiple times via Finder/Command Line/grep/find and could not find any duplicated frameworks.
Ensured I did not add any "import *.m" files accidentally.
Checked for red files/duplicates in the Frameworks folder as well as the "Link Library With Libraries" section of "Build Phases."
Checked my framework, header, and other linker paths and they seem to be alright. My "Other Linker Flags" contains "$(inherited)" and a -force_load call to a third party ".a" file for analytics.
Cleared ~/Library/Developer/Xcode/DerivedData as well as removed Pods/ and ran "pod install" multiple times.
I went on to investigate the problem in the Parse files. The only place where PFConfigParametersRESTKey is defined is here and here. This seems alright since one of them is preceded by the extern keyword(reference here). I tried messing with the source files a little bit by making this variable not static and also trying to rename one of them. Nothing worked. I cannot figure out where to look to fix this.. If anybody can shed some light here I would greatly appreciate it! Thank you.
The solution to my problem was to remove an -ObjC flag from the linker config. For some reason, -ObjC was not one of the entries in the Linking section of Build Settings. The way I found it was by going to Pods/Pods-MYAPP.debug.xcconfig, and manually removing the -ObjC flag from the OTHER_LDFLAGS variable.

adt error - "... is not part of a Mac OS X Native Extensions framework"

I'm trying to package some code up as an ANE, something we've done before in house. However we're currently stuck on an ADT error which I can't seem to wrap my head around.
When running the following from a sh file, I'm getting an error.
Shell script:
ADT="/Applications/air/bin/adt"
NAME="VideoRoll"
AFILE="libVideoRollANE.a"
$ADT -package -target ane $NAME.ane extension.xml -swc $NAME.swc -platform iPhone-ARM -platformoptions platformoptions.xml library.swf $AFILE
Error:
platformoptions.xml is not part of a Mac OS X Native Extensions
framework
All of the files are in the correct place and being clearly picked up by adt, as I'd assume there would be something else I'd be getting back. If you're after the source code, it's an open source library on bitbucket that I've forked and made a couple of changes to. I'm trying to compile it with Adobe AIR SDK 20 to try and fix an issue we're getting but I'm struggling to just build it from the base source right now. The source can be found here: https://bitbucket.org/lostirc/videoroll/src .
Any suggestions would be great, I'm up for trying anything now. I've modified nearly everything I can think of and tried various different orders for the command, it seems if I remove the platformoptions flag and value, then it gives the same error about library.swf, so I'm not sure it's directly related to the platformoptions.xml.
I worked around the problem by running the same command on Windows. This isn't really a solution but a potential workaround for anyone having the same issue. If anyone can post a good answer then I'll accept that, but for now this is the best answer I've got.

Trying to compile libgdx to html, but it cant clear the assets

Having trouble compiling my libgdx project to html.
Looking at the log I think the problem is;
Copying resources from ../android/assets to war/
C:\TomsProjects\MeshExplorerV2\html\..\android\assets
C:\TomsProjects\MeshExplorerV2\html\assets
[ERROR] Generator 'com.badlogic.gdx.backends.gwt.preloader.PreloaderBundleGenerator' threw an exception while rebinding 'com.badlogic.gdx.backends.gwt.preloader.PreloaderBundle'
java.lang.RuntimeException: Couldn't clean target path 'war\assets'
Now it strikes me as slightly odd the second line; As there was no html\assets folder.
The assets folder was in html\war\assets, like the last line complains about.
However, after creating a empty assets folder in html, and manually deleting the contents of html\war\assets I still get the same error.
Theres also a "html\webapp" directory without any assets folder. Not sure if there should be one.
I have tried cleaning/rebuilding from eclipse, as well as randomly also trying Gradle>>Refresh All.
Additionally, the Java version runs just fine.
Any pointers, thanks :)
While not exactly reveling the route of the problem, I noticed it let me compile again as long as I restarted eclipse inbetween.
This infers some file-lock going on, possibly a server still running, allthough nothing but the gwt compile as triggered by me.
Still, restarting is a fine workaround for me as it only takes a minute or two.
ah
Pinned it down: Close your FTP program when compiling - at least CoreFTP was locking the directory. Closing it works every time now.
I had a similar issue where I was getting the following error
[ERROR] Generator 'com.badlogic.gdx.backends.gwt.preloader.PreloaderBundleGenerator' threw an exception while rebinding 'com.badlogic.gdx.backends.gwt.preloader.PreloaderBundle'
java.lang.RuntimeException: Couldn't clean target path 'war/assets'
All my files under the html/war/assets directory were read only, re-starting the IDE didn't help. To fix it I needed to change permissions chmod -R 777 html/war/assets (you probably dont need 777).