GoogleTV Closure Library Getting Started - google-tv

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.

Related

How does !npx degit work in Google Colab?

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

How do I use a Github program where the .exe does not exists?

I try to use programs or scripts on github form time to time, and several times I find myself incapable of executing the program and that is generally because the tutorial points towards a .exe or that does not exists on the github repository (folder containing all the gihub project files).
This is the perfect example :
https://github.com/agaboduarte/AliExpressScraper
This indicates that for using it you put
alishop.exe -ProductId=32704963843
or
alishop.exe -ProductUrl=https://pt.aliexpress.com/store/product/Original-Meizu-MEILAN-E-5-5-inch-2-5D-FHD-1080P-MTK-Helio-P10-Octa-Core/103919_32712980451.html?detailNewVersion=&categoryId=5090301&spm=a2g03.8047714.2169898.2.6F0m5X
As command line.
But there is no such file as 'alishop.exe' in this repo !
The only other .exe file that there is is NuGet.exe, so I tried to use
NuGet.exe -ProductId=32704963843
Result : the command '-ProductId=32704963843' is said to be 'unknown' (command launched in the folder containing NuGet.exe of course)
Any idea of what do I do wrong ?
Source code must typically be built or compiled. In this case, it's a C# project, and expects you to have Visual Studio.
In other cases, Github projects may simply be scripts, documents, or plugins. They may not be standalone executables, and you will need other tools to make use of them.

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.

ST2 Mocha CoffeeScript symbols

Anyone know if there's a way to browse Mocha tests (in CoffeeScript)via Sublime Text 2 symbols list? Ideally there'd be a plugin, but I'd be fine with editing my CoffeeScript plugin to look for describe and it. I don't know how the whole tmLanguage thing works, could someone show me how to do it or let me know the code to add.
It'd be super rad to navigate my testes using ST2 symbols list!
Thanks!
Although CoffeeScript has a good coloring support in ST2, it's pretty bad in Go To Symbol panel.
I've created a fork of original plugin, where (along with some other cosmetic changes) it shows all classes and functions defined in a file, as well as some known method invocation such as 'describe', 'it' for Mocha and 'app.get', 'app.post', etc for Express.
Currenly it looks like this:
You can see the changes diff on GitHub.
To install it, either download the package and unzip its contents to your Packages/CoffeeScript directory, or git clone it (dont forget to close ST2 beforehand):
cd <user directory>/Packages
rm -r CoffeeScript
git clone -b correct-goto-symbols git://github.com/ashtuchkin/CoffeeScript-Sublime-Plugin.git CoffeeScript
I've also added it as a pull request to the original plugin author, so lets hope it will be in standard package soon.

how to run doctrine.php in command prompt

I'm trying to use Doctrine with Zend, I have copied the doctrine.php and doctrine file in the script folder in the Source Files folder.
However when I type in command prompt following command: "php doctrine.php" by entering in the scripts folder, Nothing happens, there is no error printed, the cursor just goes to next line. Can someone please tell me how can I use doctrine.php.
When using Guilherme's integration suite, you need to do a couple of things.
Download / clone the Doctrine Common, DBAL and ORM libraries and make sure they're available in your include path. For this, I usually just copy the lib/Doctrine code from each into my project's library folder. If using git, you can add them as subtree splits but that's a topic for another time ;-)
You also need the Symfony Console and Yaml namespaces. Again, it's easiest to place them in your project's library folder under library/Symfony/Component/Console and library/Symfony/Component/Yaml. These usually come as submodule dependencies in the Doctrine libraries but you can also get them from their github pages
Console
Yaml
Remove the bootstrap('Config') call from the doctrine.php script. Don't know what Guilherme was thinking there :-)
That's it, from there it should work as expected.