How does !npx degit work in Google Colab? - github

I'm trying to read files from my Github repository in Google Colab. I found this answer that instructed me to use:
!npx degit Jainu-s/urldata/al -f
Which copies the files from my repository as local Colab files. It works perfectly, but I have no ideia what this code does exactly and I could not find any Colab documentation on it.
Can anyone explain to me how it works? What is its syntax, what does it do? And what are the options I could use with it?

You can read its documentation.
https://github.com/Rich-Harris/degit
Basically,
the program is degit
npx is to execute without install it
/al means you download that directory content
f is force download, because the directory is not empty
To read more
!npx degit --help

Related

How do you download files from gs cloud for tensorflow tutorials

I'm trying to follow some of Tensorflow's tutorials. Specifically this one:
https://www.tensorflow.org/lite/tutorials/model_maker_object_detection
It has a step that uses files in Google cloud storage. That step fails. It seems I should be able to manually download that file(s). But I can't click on the URL. I've poked around in Google Cloud storage, but it appears it costs money and I can't seem to figure out how to "copy" that file(s) from someone else's cloud storage to mine.
Am I missing something simple?
You can use gsutil command line tool
For example
gsutil cp gs://cloud-ml-data/img/openimage/csv/salads_ml_use.csv /tmp/
It may ask you to login first - just follow the commands that shows on screen.
For more details see https://cloud.google.com/storage/docs/downloading-objects#gsutil
For that example it does need login details. You can open the notebook on Google colabs and download as in the above:
! gsutil cp gs://cloud-ml-data/img/openimage/csv/salads_ml_use.csv /content/

workspace.fs is not available in vscode API to read the file

I wanted to use vscode.workspace api to deal with file operations instead of node fs module as shown in the following Git Repo. But i am not able to access fs inside workspace.
You may need to run npm install #types/vscode to ensure you have the latest types for vscode. This resolved our problem when trying to use vscode.workspace.fs.

how to compile kdesvn from githib repo

I've downloaded the sources for kdesvn from the github repo as I'm thinking to look into working on an addition to the project. Now turns out, I'm not even able to properly compile the downloaded sources: I've created a directory kdesvn-build changed into it and launched cmake ../ (as described on https://github.com/KDE/kdesvn/blob/master/INSTALL-cmake) which does some stuff but then stops saying:
CMake Error: The following variables are used in this project, but
they are set to NOTFOUND. Please set them or make sure they are set
and tested correctly in the CMake files: SUBVERSION_INCLUDE_DIR
Now, I don't know what SUBVERSION_INCLUDE_DIR should be set to nor could I find it searching around the web. Anyone?
It is a directory containing svn_*.h files. If you are on Linux, you'd need to install something like subversion-dev package. On FreeBSD headers are installed with main package, and the directory is /usr/local/include/subversion-1/.

Installation using GitHub

I don't know the first thing about programming, but I came across something I would like to install using GitHub.
These are the steps:
Fork or Clone the repository.
Run npm install while in the directory of the project.
Open chrome and load in a new "unpacked extension" from the extensions screen.
Open project folder and load in the src folder in /chrome.
Open /app/containers/auth.js/sagas.js/ and edit the variable --CHROME_EXTENSION_ID to the one found in your chrome extensions screen.
Run npm start in the root directory of the project.
Navigate to localhost:3000/login and the chrome extension will handle the login process.
I got the "clone the repository" part lol.
Is this something that anyone can easily teach me how to do or does it require some kind of programming knowledge?
I'm sorry for the layman post.
Thanks in advance
Fork or Clone the repository. (this is covered above)
You should start by searching Google for "How do I clone using git". Git is a tool, GitHub is just a cloud service for git. git has help built in.
git help
Typically you would do this assuming you have git installed.
git clone <git repo>
Git questions need to go on SuperUser.com too.
So, it looks like you are trying to install something for NodeJS. Installing NodeJS can sometimes be tricky, but use Google if you get stuck with specific errors.
run npm install while in the directory of the project.
Typically you just need to cd into the folder you just cloned.
Then you just run:
npm install
This installs the libraries (dependencies) that the program you are using needs. Keep an eye out for any warnings.
Open chrome and load in a new "unpacked extension" from the extensions screen.
Open Chrome and paste this URL: chrome://extensions/
Open project folder and load in the src folder in /chrome.
Ideally, you have a text editor like Atom or Sublime Text. You'll want to open the Git folder you 'cloned' earlier. Both are great, Atom is free.
Open /app/containers/auth.js/sagas.js/ and edit the variable --CHROME_EXTENSION_ID to the one found in your chrome extensions screen.
I would need to see the file to help here. If it's Java it might look like this:
var CHROME_EXTENSION_ID = "SOME_ID";
or it could be in JSON format:
{
CHROME_EXTENSION_ID: "SOME_ID"
}
run npm start in the root directory of the project.
So, inside the folder you cloned you run this to start a NodeJS server.
npm start
This typically will start a local server on your computer.
Navigate to localhost:3000/login and the chrome extension will handle the login process.
An id all does well, you would just be able to open this URL in Chrome.
http://localhost:3000/login
If all went well you should be able to point the browser at your computer and see whatever you are expecting.

GoogleTV Closure Library Getting Started

I've been trying to figure out how to use the google closure library for d-pad navigation for my web app. I cannot for the life of me get closure to work. I'm following google's guide here https://developers.google.com/tv/web/lib/closure/gettingstarted
The guide asks to checkout from their SVN repo, but I'm just using the downloaded zip of the library from github. The guide asks to perform the following command
gtv-ui-lib/closure-library/closure/bin/build/depswriter.py \
--root_with_prefix="gtv-ui-lib/source ../../../../gtv-ui-lib/source" \
--output_file=tv-deps.js
to create a deps.js file. Can somebody explain to me how to execute this command? Is it supposed to be in a python command prompt or something else? When I copy and paste their exact html and javascript page code and use the premade deps.js file for the guide, my page doesn't function with keyboard navigation, so I'm assuming the deps.js file is my problem because everything else is exactly from the guide.
You will need to have python installed on your development machine and make sure that it is added to your path environment. The closure depswriter can be executed by using python from the command line (if you are using *nix then you can just invoke the file from the cli). Try:
python WHERE-YOU-UNZIPPED-THE-ZIP-PATH/gtv-ui-lib/closure-library/closure/bin/build/depswriter.py \
--root_with_prefix="gtv-ui-lib/source ../../../../gtv-ui-lib/source" \
--output_file=tv-deps.js
I would also recommend checking out the source from the SVN repo and not using the github zip file. The SVN repo is the most upto date and the github is a mirror that can sometimes fall behind. To ensure you have the latest version of the code do install the SVN tools and checkout from the specified repo.