Thursday, April 15, 2021

CORS header 'Access-Control-Allow-Origin' missing and Java Servlet

 As it is answered here, HttpServlet.doOptions() method has to be overridden the following way:

import java.io.IOException;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
@WebServlet(
    name = "MyServlet",
    urlPatterns = {"/myservlet"}
)
public class MyServlet extends HttpServlet {
	
    @Override
    protected void doOptions
        
(
            
HttpServletRequest req,
            HttpServletResponse resp
        )         throws IOException {         resp.setHeader("Access-Control-Allow-Origin", "*");      resp.setHeader("Access-Control-Allow-Methods", "POST, OPTIONS");      resp.setHeader("Access-Control-Allow-Headers", "*");     }     @Override     protected void doPost
        (
            HttpServletRequest req,
            HttpServletResponse resp
        )         throws IOException {         resp.setHeader("Access-Control-Allow-Origin", "*");         resp.setContentType("text/plain");         resp.setCharacterEncoding("UTF-8");         resp.getOutputStream().println("OK");     }     @Override     protected void doGet
        (
            HttpServletRequest req,
            HttpServletResponse resp
        )         throws IOException {         doPost(req, resp);     } }

Sunday, April 11, 2021

Covid19 Travel Information - updated daily

Another web project finished. This time daily updated corona virus related travel information at:

Covid19 Travel Information

HTML, javascript without any frameworks, only Papa Parse for CSV parsing and python for data processing. Data is fetched from The Humanitarian Data Exchange. There is no database at all and site is hosted on GitHub Pages!

Covid19 Bar Chart Race

I got bored watching 'ordinary' corona virus charts, I couldn't find updated bar chart race, so I made it myself. A small weekend project at:

Covid19 Bar Chart Race

Data comes from The Humanitarian Data Exchange, it is processed with python and Flourish is used for visualization. Unfortunately, automatic data upload is available in their business plans only, so there is one manual step left to. Hosted on GitHub Pages!


Saturday, April 3, 2021

NOAA API web servers rejecting Android app requests (error code 403)

Probably it is a NOAA's (National Oceanic and Atmospheric Administration) response to problems outlined in this article: Weather Service Internet systems are crumbling as key platforms are taxed and failing.

HTTP(S) requests to weather.gov servers made from Android apps (that are using default User-Agent header) are failing with error code - 403 Forbidden. Not sure exactly since when, and not sure what User-Agent headers are blocked, in my case it was a testing device with:

"Dalvik/2.1.0 (Linux; U; Android 5.0.2; Android SDK built for x86_64 Build/LSY66K)"

 The solution is pretty simple, you have to make request with User-Agent header set as described in this Stack Overflow answer


Monday, December 28, 2020

PayPal Europe VAT number is LU22046007

The bigger they are (and the more we depend on them), the more their customer support sucks. There is no way you will find out this data by contacting them through the available channels, so here it is for all desperate people who need it for their accounting purposes. I am throwing in some extra contact data as I am feeling extra inspired by PayPal's cooperativeness. 

P.S: Don't forget that starting from December 16, 2020 European PayPal accounts are charged an inactivity service fee (if you have no activity in previous 12 months) that is €10 EUR. I am moving my business away from them.


Full address:
PayPal Europe S.a.r.l. & Cie, S.C.A.
5th Floor
22-24, Boulevard Royal L-2449
Luxembourg

Administrative & financial information:
International VAT number : LU22046007
Nace : Sociétés de participation financière (Soparfi) (64202)
Trade registry No. : B127485
Capital : 2 200 000 €
Number of employees : 200
Date of creation : 04/2007

Phone numbers:
+352 26 63 91 00   Mr. Paul Marriott-Clarke (CEO)
+352 27 85 88 27
+352 26 11 53 399 
 
Fax:
 +352 26 63 92 50

Email address: 


Sunday, June 28, 2020

Mauro Giuliani studies - Isaias Savio's 23 selected studies (estudios escogidos)


Savio Study No.1
Savio Study No.2
Savio Study No.3
Savio Study No.4
Op.100, No.3Savio Study No.5
Op.100Savio Study No.6
Op.100, No.11Savio Study No.7
Op.100, No.13Savio Study No.8
Op.100Savio Study No.9
Savio Study No.10
Op.100Savio Study No.11
Savio Study No.12
Op.100Savio Study No.13
Op.100Savio Study No.14
Op.100Savio Study No.15
Savio Study No.16
Savio Study No.17
Op.100Savio Study No.18
Op.100Savio Study No.19
Savio Study No.20
Savio Study No.21
Savio Study No.22
Savio Study No.23

Fernando Sor studies - Andrés Segovia and Napoleon Coste editions


Op.6, No.8Segovia Study No.1
Op.35, No.13Segovia Study No.2Coste No.1
Op.6, No.2Segovia Study No.3
Op.6, No.1Segovia Study No.4Coste No.6
Op.35, No.22Segovia Study No.5
Op.35, No.17Segovia Study No.6
Op.31, No.21Segovia Study No.7
Op.31, No.16Segovia Study No.8
Op.31, No.20Segovia Study No.9
Op.31, No.19Segovia Study No.10
Op.6, No.3Segovia Study No.11
Op.6, No.6Segovia Study No.12
Op.6, No.9Segovia Study No.13
Op.6, No.12Segovia Study No.14
Op.35, No.16Segovia Study No.15Coste No.5
Op.29, No.23Segovia Study No.16
Op.6, No.11Segovia Study No.17
Op.29, No.22Segovia Study No.18
Op.29, No.13Segovia Study No.19
Op.29, No.17Segovia Study No.20