A PHP CORS example

Cross Origin Resource Sharing

gearsA webpage makes a cross-origin HTTP request whenever it requests an image, stylesheet or script from a different domain than the one which served itself. A good proportion of websites on the internet rely on the ability to make such requests. However, when a cross-origin HTTP request is initiated from within a script in a webpage, web browsers block the request for security reasons. The best example is Javascript’s XMLHttpRequest function, which follows the same-origin policy. This means that a web application using XMLHttpRequest within a script can only make HTTP requests to resources located within its own domain.

Continue reading “A PHP CORS example”

Golang libraries for data science

wowThe Golang programming language is on a par with Python when it comes to ease of use, but the code compiles to a binary that runs almost as fast as C. So Golang is worth considering for any task that crunches large volumes of data. This is a curated list of Golang libraries useful in data science and related fields.

Continue reading “Golang libraries for data science”

MySQL database migration

 

gearsI recently upgraded my development laptop to CentOS 7 and while I was at it built a spare laptop running the same operating system. After manually creating a dozen MySQL databases and users and then importing their data from dump files on one laptop, I wasn’t interested in going through exactly the same process again on the second laptop.

Continue reading “MySQL database migration”