How do I use Rambda from the console when on its website? - console

If I go on Lodash's page, and enter the console, I can immediately type _. and I will have access to all Lodash's functions.
Can I do something similar on Rambda's website? R. doesn't seem to trigger any autocompletion suggesting I can.

Related

When I try to clear the workspace in R console, it always asks through a pop-up. How can I disable the pop-up?

When I try to clear the workspace in R console, it always pops up a dialog saying:
All objects in the workspace will be removed. Are you sure you want to proceed?
Can I have a way to disable this popup?
There are some suggestions (here) depending on your platform. Looks like passing the "no-save" option when invoking R is your best bet: https://stackoverflow.com/a/4996252/8273813

How to download files in a moodle course using R?

There is a moodle course with files that I wish to download automatically. I see that there is a python solution for doing so, but I couldn't find an R solution. I am not sure which package and what type of workflow would fit here (I assume some combination of httr and rvest). Any suggestion would be appreciated.
The first problem is how to deal with the authentication of moodle. In my case, I need 3 items (personal id, user name, and password).
From a google search I was able to find the following moodle related packages (non seem to help): SARP.moodle, moodler. Using download.file on the homepage of the course only redirects to the page viewed by people who do not have access to the course. No pop-up window shows for entering passwords (and again, in my case there is a need for 3 items of the password).

Web scraping Oracle (ATG) Commerce

I am new to web scraping, and I use the following tool and method to scrap:
I use R (with packages Curl, XML, etc) to read the web pages (with a url link), and htmlTreeParse function to parse the html page.
Then in order to know get the data I want, I first use the developer tool i Chrome to insepct the code.
When I know in which node the data are, I use xpathApply to get them.
Usually, it works well. But I had an issue with this site: http://www.sephora.fr/Parfum/Parfum-Femme/C309/2
When you click on the link, you will load the page, and in fact it is the page 1 (of the products).
You have to load the url again (by entering a second time the url), in order to get the page 2.
When I use the usual process to read the data. The htmlTreeParse function always gives me the page1.
I tried to understand more this web site:
It seems that it is built with Oracle commerce (ATG commerce).
The "real" url is hidden, and when you click on the filter (for instance, you select a brand), you will get url with requestid: http://www.sephora.fr/Parfum/Parfum-Femme/C309?_requestid=285099
This doesn't help to know which selection I made.
Could you please help:
How can I access to more products ?
Thank you
I found the solution: selenium ! I think that it is the ultimate tool for web scraping. I posted several questions concerning web scraping, now with rselenium, almost everything is possible.

How to programmatically upload files to Maniphest ticket using Conduit?

i can't find the documentation anywhere for how to actually use the Conduit API. I'm able to create a task using some really weird methods, but once i create the ticket, i can't find any documentation about how to actually upload a file anywhere.
i tried looking at:
https://secure.phabricator.com/conduit/method/maniphest.createtask/
and i get so confused on how this actually works. what actually is this?
I think you need to upload the File separately through the file.upload conduit method, then use an {Fnnn} reference in the Task or Comment text to link to it. I presume when file.upload says it returns a GUID, it means a PHID, so you'll also need to use file.info to get the id to use in place of the nnn in the reference text.

Different "clickable" log items in Chorome Dev Tools console

When I console.log a javascript object or array in Chrome Dev Tools I get a nice and clickable "drilldown" tree representation where I can inspect the various values, their keys and values with all the syntax highlighting, (i) icon, .length shown etc.
Is there some extension API for doing/changing this behaviour so it is different for some other classes/instances? My idea was to format Clojure data structures so one can inspect them the same way.
EDIT: I know I can do a simple formatting in console.log via %c etc., but that is only a tiny fraction of what I want to do.
So far I wasn't successful with googling. If you know where is the correct Chrome extension API written, can you please point me to the right direction?
There are no current extension APIs for customizing console output. https://code.google.com/p/chromium/issues/detail?id=142783 tracks that item. The team is open to a patch for this, if you'd like to look into tackling the implementation.
What you can do is to override console.log and, when object you are interested in is being printed out, use own function for printing it. To achieve something similar to the default object output you should probably use console.group and console text formatting (shown bellow).
See the official docs for more tips on using the Console.

Resources