How can I use RegionCentroid[] to find geometric centroid of the given country shape?
GeoGraphics[{EdgeForm[Black], FaceForm[Black],
Polygon[Entity["Country","Italy"]]}, GeoBackground -> None, PlotRange -> All]
@kirma David's answer may be correct: CountryData["Italy", "CenterLocationLink"] depending what stands behind it. And yes, it would be good to ask OP about assumptions.
I was often complaining about the front end performance under Linux, but it seems I could pin down a very critical issue. I made a screen-cast that shows how to reproduce the issue
Screen-cast on YouTube
How to reproduce: Open a fresh Mathematica and type some code. In the screen-cast I used
...
Very disappointing. It's why I hate using Mathematica on Linux. And because I use Mathematica a lot, I ended up hating to use Linux ...
I don't feel safe being stuck with OS X, expensive Macs, and at the mercy of Apple. But Windows sucks for scientific programming and Linux sucks for using Mathematica.
It seems that sources of URL* related features are not initialized properly which leads to problems in many cases.
Please follow those steps to reproduce the problem:
Let's deploy a test api:
api = First @ CloudDeploy @ APIFunction[
{}
, HTTPResponse["", <|"Content" -> "TEST", "StatusCo...
@Szabolcs It really is OK most of the time. And you have to remember that even the front end on OSX is lightyears away from the one that runs on Windows.
@halirutan Is it only copy/paste that triggers it? Until I read your post, I wasn't sure what caused it. All I knew was that it kept happening every time I used Mathematica on Linux.
@Kuba Well, it runs in low resolution and it is consistent. That's much better than some of the half-hdpi-aware programs that show big and tiny UI elements side by side.
@Szabolcs If I remember correctly, yes. When I experience weird behaviour, I often try to stop and reproduce it. When my memory doesn't fail me, I discovered this bug when I was writing a post on SE or trying something out that was given in an answer.
I just saw that at some point the FE was really messed up, so I restarted it and tried again. After a while, I could pin it down to the moment when I copied the code into the notebook.
@Szabolcs Yes. At home I'm completely on Linux. I don't like to work on my MacBook. At work I have a MacPro. So it's probably 60% Linux.
The real problematic part is, that many bugs I have reported years ago are still in 11. That is really annoying.
how about this? URLRead[HTTPRequest[URL["https://www.httpwatch.com/httpgallery/authentication/authenticatedimage/default.aspx"],<|"Query"-> ToString@RandomReal[]|>]]
or better: URLRead[HTTPRequest[URL["https://www.httpwatch.com/httpgallery/authentication/authenticatedimage/default.aspx"],<|"Query"-> ToString@RandomReal[]|>, Interactive->False]]
This issue is similar to one from a recent report:
Inconsistent HTTPResponse handling
but I decided to post a separate question because I have a fix for this one and not for the linked one.
So, let's call where we should not:
URLRead["https://httpbin.org/status/401", Interactive -> False]
...
@Kuba I did see the interactive auth trigger once on some code that I thought for sure had Interactive->False set. So maybe this was the cause. Good to know.
I believe we can explain this behavior by referencing:
Working with Unevaluated Expressions - Robby Villegas
Unevaluated must be wrapper before argument evaluation, not after, else it isn't stripped.
Recall our discussion of the over-arching evaluator, and the fact that
your inputs ...
I really am itching to learn to use mathematica as a proper programming language rather than something I just cram unruly expressions through Integrate and pray and wait a few minutes for