Not sure how to run the test image script here
https://github.com/cessen/lut_extractor
Does it require certain dependencies?
Apologies if it's black and white in the readme but I can't get it to work.
Once you've cloned the repository and entered it in a command line:
git clone https://github.com/cessen/lut_extractor.git
cd lut_extractor
generate the test image using 'cargo':
cargo run -- --test-image
If you followed these steps, the test image will be available in the 'lut_extractor' folder, named 'lut_extractor_2560x1440.exr'.
You'll need git and cargo to run these instructions.
On the command line to install rust (MAC) (copy the entire line)
"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"
You will also need to verify installation
"rustc --version"
"cargo --version"
After that your rust is completely set up, clone the repository in the command line:
"git clone https://github.com/cessen/lut_extractor.git"
To run anything using Rust, the command is "cargo run" and for you, the command is
"cargo -- --test-image"
Related
I have checked out https://github.com/gitpod-io/template-haskell
and merged samples for a book (haskell in depth) into my branch.
Prebuilding has no effect, every opening of a workspace begins the entire build process from the beginning. So gitpod is effectively unusable for this project, as Zou have to wait for the entire build to complete, before ou can start using the workspace.
I presume the reason might be, that stack build stores the build artefacts in ~/.stack and that location is not part of the workspace, so it's lost when the workspace is closed.
Is that right? And then, how to keep the build result alive?
I just started using Gitpod so I'm not sure if there's a better way to do this, but I was able to get pretty close to what I wanted out of a prebuild by specifying a base dockerfile by putting this in my gitpod.yml:
image:
file: .gitpod.Dockerfile
and then creating a .gitpod.Dockerfile that starts with
FROM gitpod/workspace-full
and then install ghcup and use it to install my other dependencies:
RUN curl --proto 'https' -tlsv1.2 -sSf https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > ./ghcup
RUN chmod 755 ./ghcup
RUN sudo mv ./ghcup /usr/local/bin
RUN ghcup install ghc
RUN ghcup install cabal
RUN ghcup install hls
RUN ghcup install stack
RUN sudo ln -s /home/gitpod/.ghcup/bin/stack /usr/local/bin/stack
RUN stack install ghcid
I'm try to install the package Golearn, following these instructions.
After running in the terminal
go get -t -u -v github.com/sjwhitworth/golearn
I tried to run (as required):
cd $GOPATH/src/github.com/sjwhitworth/golearn
However bash doesn't find this directory. What should I do?
(I'm using linux)
install the package Golearn
Example build, in /home/name/tmp/
git clone https://github.com/sjwhitworth/golearn.git
cd golearn/
## Completing the installation
## Run the following to complete installation
go get -t -u -v ./...
Using : Please (also) read the text file README.md .
I did the following and worked:
go get -t -u -v github.com/sjwhitworth/golearn
go: downloading github.com/sjwhitworth/golearn v0.0.0-20221228163002-74ae077eafb2
go: added github.com/sjwhitworth/golearn v0.0.0-20221228163002-74ae077eafb
go env GOPATH
/Users/<my_username>/go
cd /Users/<my_username>/go/pkg/mod/github.com/sjwhitworth/golearn#v0.0.0-20221228163002-74ae077eafb2
sudo go get -t -u -v ./...
The instruction of golearn maybe some outdated, you can follow my process:
cd into a empty folder, like /home/your/code/my_golearn, all commands below should be run at this floder
run go mod init my_golearn to init a go project, you will get a go.mod file
create a main.go file and fill it with code from https://github.com/sjwhitworth/golearn#getting-started
run go get github.com/sjwhitworth/golearn
run go mod download to get all dependencies
run go get github.com/sjwhitworth/golearn/knn, it's strange, but it doesn't work if this command miss, I think maybe the developer of golearn has some misuse of go mod
run wget https://raw.githubusercontent.com/sjwhitworth/golearn/master/examples/datasets/iris.csv -P datasets to get dataset you need
run go run ./main.go, you will get result same as https://github.com/sjwhitworth/golearn#getting-started
If you are not familiar with how to install dependency in a modern go project, it's better for you to go through https://go.dev/blog/using-go-modules
If I'm using npx to run a binary as a one-off, it'll output the following:
npx my-module
/// npx: installed 1 in 1.34s
/// Hello, from my module!
Where are these binaries stored by default? Does npx save the binaries after execution, a-la npm or does it just run them and then remove the files?
It's my understanding that npx will first look in the local node_modules/.bin diectory and then the /usr/local/bin directory, before it downloads the module. But I've checked both of those locations and don't see the new module...
npm version 7 will cache the packages in a _npx directory. It has a cache layout that apparently involves a hash. For example, for me npx shellcheck installs the executable in ~/.npm/_npx/cca5ebdff9ce100b/node_modules/.bin/shellcheck. (Note the cca5ebdff9ce100b.) However, I very much doubt that the algorithm can be relied upon to be consistent across versions of npx.
The whole point of npx is that you can run the packages without installing them somewhere permanent. So I wouldn't use that cache location for anything. I wouldn't be surprised if cache entries were cleared from time to time. I don't know what algorithm, if any, npx uses for time-based cache invalidation.
To get the location from which npx runs the package, you can use -p to tell it to install a package and then use which <executable> or command -v <executable> to get the path. So, for example, what I did above to get the location of the shellcheck executable was to run npx -p shellcheck which shellcheck or npx -p shellcheck command -v shellcheck. Those commands assume a Linux or other UNIX-like operating system. I'm not sure what the equivalent for Windows would be.
$ npx -p shellcheck command -v shellcheck
Need to install the following packages:
shellcheck
Ok to proceed? (y)
/Users/trott/.npm/_npx/cca5ebdff9ce100b/node_modules/.bin/shellcheck
$
In Windows, this would be:
C:\Users\{YourUserName}\AppData\Local\npm-cache\_npx\
or the bash shell equivalent of:
~/Local Settings/npm-cache/_npx/ etc.
Problem
I created a project where configure a server in DigitalOcean with Apache and Git.
For init project on server, I run the following command:
cd /var/repo
mkdir project-example.git && cd project-example.git
git init --bare
I set up file post-receive with this code:
#!/bin/bash
git --work-tree=/var/temp/project-example --git-dir=/var/repo/project-example.git checkout -f
cd /var/temp/project-example
npm install
npm run build
rm -rf /var/www/project-example/*
mv -f /var/temp/project-example/build/* /var/www/project-example/
When I make a push to server remote via git on machine local, occurs followings errors:
remote: hooks/post-receive: line 4: npm: command not found
remote: hooks/post-receive: line 5: npm: command not found
However, accessing server via SSH and execute command:
# it works standard
cd /var/repo/project-example.git
source hooks/post-receive
Comments
System Server: Ubuntu 14.04
I installed node via nvm.
When a git hook runs, it does not necessarily have the same PATH variable set as when you log in via SSH. Try putting the full path to npm in your script when you call it; that should fix things.
UPDATE (June 7 2019):
A couple of commenters had issues with node not being found when using the above solution, which made me realize it is not very robust. Rather than put the path in the call to npm itself, you'd be better off adding the necessary path to the script's environment, e.g. if npm (and node) happen to be in /usr/bin/, add the following to your script before calling npm:
export PATH=$PATH:/usr/bin
In fact, a more robust way to make sure the hook works the same as it does when you are logged in via SSH is to find out what the path is when you are logged in (i.e. the output of echo $PATH) and set the path in your hook script accordingly (of course you may need to omit some user-specific paths, etc.)
I am new to coffeescript. I saw a coffeescript video in Rails casts.com. From that episode I understand how to convert the normal Js and Jquery to coffeescript code and the usage of coffeescript.
I am trying to create a coffeescript example without rails. I wetn through the coffeescript site. They first install Node.js. I tried to install node.js in windows and ubuntu, but I had failures. I followed the instruction as per this site:
http://howtonode.org/how-to-install-nodejs#ubuntu
For ubuntu I got "bash: ./configure?: No such file or directory" error when I execute the following command
./configure
Can anyone help me to create simple coffescript example without rails?
One more thing - In Mac "By the help of homebrew I can see the compiled js of coffescript code through compiled and Display Js window". Are there any options available in windows and ubuntu?
I would bet the easiest way to install Node.js on Ubuntu is through APT:
$ sudo apt-get install nodejs
It probably will get some outdated version but it can be enough for some tests.
If you prefer the latest version (which is a reasonable preference), I bet it would be easier to install Node.js from the dist package. Just copy and paste this on terminal:
wget http://nodejs.org/dist/node-v0.5.0.tar.gz && \
tar zvxf node-v0.5.0.tar.gz && \
cd node-v0.5.0 && \
./configure && \
make && \
sudo make install
This line will:
download the latest Node.js source code with wget http://nodejs.org/dist/node-v0.5.0.tar.gz
uncompress the downloaded source code with tar zvxf node-v0.5.0.tar.gz
enter into the source code with cd node-v0.5.0
set the build parameters with ./configure
effectively build the Node.js executable with make
install the built Node.js in your path with sudo make install
The && means "execute the next command if the previous command succeeds" (for example wget http://nodejs.org/dist/node-v0.5.0.tar.gz && tar zvxf node-v0.5.0.tar.gz means that we will download the package with wget and iff the download succeeds we will unpack the download file with tar. The backslashes (\) are here for allowing us to break all the series of commands in more than one line because, by default, we would have a big line:
wget http://nodejs.org/dist/node-v0.5.0.tar.gz && tar zvxf node-v0.5.0.tar.gz && cd node-v0.5.0 && ./configure && make && sudo make install
Then, you can install npm with this simple command, found in the own npm github page:
$ curl http://npmjs.org/install.sh | sudo sh
With npm, it will be too easy to install coffee, as you can see in the CoffeeScript page:
$ npm install coffee-script
Now, just run your tests:
$ coffee
coffee> a = key: 'value'
{ key: 'value' }
coffee> a.key
'value'
Does it look like to much work? You can try CoffeeScript in the language page. Just click in "Try CoffeeScript" and a console will appear to you.
For testing and demo purposes it may be sufficient to have your CoffeeScript compiled directly in browser. You can include the CoffeeScript compiler and your code in a tag.
This method is not efficient though so please use it for playing around.
Please see this section on how to set things up:
"text/coffeescript" Script Tags
Good luck!
Ubuntu 11.10 has an up-to-date package for CoffeeScript.
sudo apt-get install coffeescript