Access a URL and read Data with R

In the simplest case, just do X <- read.csv(url(“http://some.where.net/data/foo.csv”)) plus which ever options read.csv() may need. Edit in Sep 2020 or 9 years later: For a few years now R also supports directly passing the URL to read.csv: X <- read.csv(“http://some.where.net/data/foo.csv”) End of 2020 edit. Original post continutes. Long answer: Yes this can be done … Read more

Is it possible to link to a bookmark within a PDF using URL parameters?

Yes, you can link to specific pages by number or named locations and that will always work if the user’s browser uses Adobe Reader as plugin for viewing PDF files. For a specific page by number: <a href=”http://www.domain.com/file.pdf#page=3″>Link text</a> For a named location (destination): <a href=”http://www.domain.com/file.pdf#nameddest=TOC”>Link text</a> To create destinations within a PDF with Acrobat: … Read more

Share link on Google+

Yes, you can. https://plus.google.com/share?url=YOUR_URL_HERE Edit: It works only with eff.org. Edit: As of March 2012 it works on all sites. Documentation for this sharing method is available on the Google Developers site.

URL Scheme for Phone Call

The official standard for providing a telephone number as a URI is here: http://www.ietf.org/rfc/rfc3966.txt It basically says use tel: as the prefix, and start the number with +[international dialling code] before the number itself. You can put non-numeric characters as separators (e.g. -) but they must be ignored. So a London (UK) number might be: … Read more

Combine URL paths with path.Join()

The function path.Join expects a path, not a URL. Parse the URL to get a path and join with that path: u, err := url.Parse(“http://foo”) if err != nil { log.Fatal(err) } u.Path = path.Join(u.Path, “bar.html”) s := u.String() fmt.Println(s) // prints http://foo/bar.html Use the url.JoinPath function in Go 1.19 or later: s, err := … Read more

Nginx causes 301 redirect if there’s no trailing slash

I posted a possible solution to this problem on serverfault; reproduced here for convenience: If I understand the question correctly, you want to automatically serve, without using a 301 redirect, http://example.com/foo/index.html when the request is for http://example.com/foo with no trailing slash? Basic solution that works for me If so I’ve found this try_files configuration to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)