how to run a coffee-script project in cloud 9 - coffeescript

I've been contemplating moving my project over to cloud 9 IDE but have been having trouble running coffee script in the project. I copied over all my js and coffee files but can't seem to get a run configuration working using the coffee files. I tried compiling the coffee files in the console command line as well as creating a run configuration that calls the app.coffee directly but no luck.
What is the coffee script support on cloud 9 and how does it work. Does it compile the coffee script to js automatically? How do I need to configure my run settings in cloud 9?

I got it working... your results may vary, but this is what I did...
Assuming you have your app which is called app.coffee, I created a file called runner.js with the following code:
require("coffee-script");
require("./app");
From the Cloud9 IDE, I just tell it to run the runner.js file and it seems to work.
I also wasn't able to use my global npm-installed packages... not sure why, but I am guessing it is just a pathing issue. Anyways, I just installed my packages into my project directory:
npm install coffee-script
I was also using express and restler in my project so I did the same thing in the project. It worked beautiffuly :)

There is an entry on the Cloud9 support page on running node.js applications written in CoffeeScript: Create a CoffeeScript node.js project. Note that you can only debug the javascript files.

Related

Programming in Swift on Linux

I would like to prepare the environment for working with Swift on Ubuntu 16.04.
I installed Swift and Atom editor.
I installed the Script package, which allows me to run code from the Atom editor.
Generally it is nice when I compile and run one file (Ctrl+Shift+B shortcut).
The problem is when I would like to build a project composed of several files.
Classes defined in the other files (not the one I compile) are not visible (compilation error).
Is it possible to configure the editor to compile and run the entire project?
How to import external library, eg ObjectMapper ?
You can use the Atom package build. It allows you to create custom build commands and such by using common build providers. You can build with a Makefile or JSON or CSON or YAML or even Javascript. It provides enough flexibility that you can build just about anything. Just make your build file so that it points to all the files to build with the right compiler (probably swiftc in your case). With a Javascript build file, you can even specify a command to run before and after the build, say, to run your newly built program.
There's a great open source project I have been watching called Marathon. It's a package manager and they have been Working on a deployment on linux. I'm not sure how much success they have had, but you can follow along here and maybe help out.
https://github.com/JohnSundell/Marathon/issues/37
Edit: It looks like it does work on linux!
git clone https://github.com/JohnSundell/Marathon.git
$ cd Marathon
$ swift build -c release
$ cp -f .build/release/Marathon /usr/local/bin/marathon
For dependencies, you should use Swift Package Manager.
You can check how Vapor is built - it is prepared for build apps for Ubuntu too.
Also, Vapor toolbox would help you with other projects
https://docs.vapor.codes/2.0/getting-started/install-on-ubuntu/
You can build a Swift project using VS Code + Swift Development Environment extension
If steps on the link above are not clear enough, I've put more details in a blog post

Component-preload.js generation

We are about to close a SAPUI5 application, one of the last steps is to make a Component-Preload.js file to improve performance. I read different guides around the web, all of them need Node.js that I have installed. I'm not expert about that package and I can't figure how to make one of that guides work. I'm developing with NetBeans. As far as I see there is not an official tool (am I right?) to generate that file. Can someone with more experience than me suggest a working, well-explained guide to perform that task?
I don't know if this could help, that's my working tree:
There are several main ways of doing it.
You can use SAP Web IDE to generate it. This assumes that you are using WebIDE to develop your application (which is not true based on your question). The regular version of WebIDE generates this file during the "client build" just before application deployment.
The "multi cloud" version of WebIDE can use a grunt build to do it. You can find more info here if you are interested: https://www.sap.com/developer/tutorials/webide-grunt-basic.html.
Use the new UI5 command line tools (https://npmjs.com/package/#ui5/cli):
Run npm i -g #ui5/cli to install the tools globally.
Open the root of your project with your terminal.
Run ui5 build preload to build the preload.
Use the #sap/grunt-sapui5-bestpractice-build pre-configured grunt tasks. The downside is that they are more-or-less black boxes which do not allow that much customisation. You can find an example setup on SAP's GitHub repository jenkins-pipelines. In a nutshell:
You need to define an .npmrc file which adds the #sap npm registry: #sap:registry=https://npm.sap.com.
Run a npm init command such that you generate a package.json file. This file describes your application and your dependencies (runtime dependencies and dev dependencies; you will only have dev dependencies for now, as you just want to build your app). Make sure to mark the package as private. See the npm docu (at the end of the license chapter).
Then you can install grunt and the build configuration: npm i grunt -D and npm i #sap/grunt-sapui5-bestpractice-build -D.
Lastly you need to define a simple Gruntfile (you can then run the build by just running grunt):
module.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('#sap/grunt-sapui5-bestpractice-build');
grunt.registerTask('default', [
'lint',
'clean',
'build'
]);
};
You can use the official grunt_openui5 plugin to generate the preload file(s). In order to be able to do this, you need to have node installed:
Create a package.json (e.g. through npm init).
Install grunt by writting in the console: npm install grunt-cli --save-dev.
Install the official openui5 grunt plugin: npm install grunt-openui5 --save-dev.
Now you have all the tools necessary, you just need to tell grunt what it has to do. You should create a Gruntfile.js in the root of your project. In this file you should configure the grunt openui5 task as described in the official github page (I linked it above). You can find a similar file here (it has more build steps like minification and copying the result files in a separate directory).
You can then run the grunt build by simply running grunt <task_name> in the console. If you registered your build task as the grunt default task (like in the sample file: grunt.registerTask('default', [...]);) then you just have to write grunt.
I think you should be able to integrate such a command line script (i.e. to run grunt) inside your IDE as an external tool.
You can use the unofficial gulp-openui5 tool to generate it. I would not recommend this if you are not already using gulp for your builds (as it is not a tool built by SAP). The procedure is the same, but using gulp for building the app instead of grunt (so you need to install node, npm init, install gulp, create the Gulpfile, etc).
Note that for most of the above methods, you need nodejs, which you can download and install from here: https://nodejs.org/en/download/.

Debug Error Occurred in Eclipse

I'm trying to debug an open source package, called libprotoident in Eclipse, Kepler version, within Debian. As it has the Makefile, I choose to make an empty Makefile project, and then add all the sources into the workspace. So after that the source compiled and run successfully as in the command line using the Makefile.
As it has 4 apps you can use, I choose to run lpi_protoident package in the run configuration window, as the following image shown.
So the Program ran successfully. Now I'm trying to debug it but it generates the following error.
How can I solve this error and debug the Project?
The file you are trying to debug is most likely a shell script created by automake that acts as a wrapper around the real executable, which has been built in a hidden directory.
Instead of telling Eclipse that tools/protoident/lpi_protoident is your application, try using tools/protoident/.libs/lpi_protoident instead.
General Answer about the error you are getting
What not in executable format: File format not reconized error means is that lpi_protoident is not an executable on the platform you are working on.
Are you sure that is an executable you can run (E.g. from the command line)?
There is also the small chance that the GDB you are using is somehow incompatible with the executable, but that is less likely.
Building libprotoident from source
(Assuming you are trying to build https://github.com/wanduow/libprotoident)
You are trying to build an automake project. The normal way to do that is by configuring to create Makefile, you shouldn't be making your own makefile. Please refer to the README in the project, but the key parts you need to do are:
Installation
After having installed the required libraries, running the following series of commands should install libprotoident
./bootstrap.sh (only if you've cloned the source from GitHub)
./configure
make
make install
By default, libprotoident installs to /usr/local - this can be changed
by appending the --prefix= option to ./configure.
The libprotoident tools are built by default - this can be changed by
using the
--with-tools=no option with ./configure.

How do I get debugging to work after building VS Code from source?

I built VS Code from source following the guide How to Contribute. It seems to build fine and launches in Electron.
Problem:
When I try to build vscode-samples, both with the included JavaScript and TypeScript versions (I ran npm install on each first), I'm not able to enter debug mode with F5. It says "Error: No extension installed for 'node' debugging."
Also...
I tried running and debugging an extension I had previously worked on for VS Code (I'm able to do this on the distribution available on http://code.visualstudio.com.
However, I'm getting a similar error:"No extension installed for 'extensionHost' debugging."
Any help would be greatly appreciated. Thanks!
The Dev build version that you are running does not include the node-debugger extension required for debugging node apps.
Lots of VSCode functionality are implemented as extensions, when the product is shipped those extensions are bundled into the released version.
if you need to run the node debugger extension within the build version, you need to add the extension to the OSS build extensions folder, to do that:
cd ~/.vscode-oss-dev/extensions/
git clone https://github.com/Microsoft/vscode-node-debug && cd vscode-node-debug
npm install && gulp build
This will pull the node extensions to dev build extension folder, then will build the extension. Next time you run, the dev build will load this extension, you will be able to do node debugging.

make virtualenvwrapper to work with different python versions

fix: sorry, all is fine, error was because of no module installed in this new environment, jinja2.
First time using virtualenvwrapper so I am little confused.
Setup went fine, I read the docs, but still I don't understand few things.
In my .bashrc file I've set:
# virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Snakepit
source /usr/bin/virtualenvwrapper.sh
I already have my project files, so I thougt I should do the following:
Go into ~/Snakepit/ directory, run mkvirtualenv -p /usr/bin/python2 [ envname ]
(I need this specific version for my project), and I saw it created in
~/.virtualenvs/ dir.
My command promt changes showing me that my new environment is [ envname ].
When I do now: python -V, it shows that I am using version 2.7 of python, so
all is well!
But when I move now, my project files into Snakepit directory, and try
running my program with python myprogram.py it shows me errors because it
still tries to run my program with python 3.
How is that possible when python -V shows version 2.7?
Error was not about python version being run, but instead module missing in newly created environment. I will leave it, for a feature reference.