Somaliland Country Abbreviation - standards

I can't find a two letter country abbreviation for Somaliland, likely because it's not a country, but rather, as Wikipedia puts it: "an unrecognized self-declared de facto sovereign state that is internationally recognized as an autonomous region of Somalia". Nevertheless, it still takes up space on a map.
This may not seem like a programming question, but it is. I'm using the jvectormap jQuery plugin, which accounts for this region and has assigned it the abbreviation "_3" in lieu of a two letter abbreviation. The problem is that in order to make jvector map function correctly with my code, I need to enter Somaliland into our database but I don't want to use "_3" as its abbreviation, and I also don't want to just make something up.
First and foremost, is there an official two letter abbreviation for Somaliland?
As trivial and petty as this problem may sound, it's created a paradox in my mind and is causing my brain to melt. How can this be handled "correctly" if an official abbreviation does not exist?

The two-letter country code for Somalia is SO. ISO added it to ISO 3166 after it received the "UN notification of full name" in July 2013. See Somalia in ISO's Online Browsing Platform.
In the Country Codes Collection, SO has a green colour code for "Officially assigned code elements".
The ISO country codes collection does not have an entry for Somaliland. The Wikipedia article ISO 3166-2:SO (i.e. Somalia's country code) states - without citing a source -
The autonomous regions of Somaliland and Puntland (the former of which claims independence but is not recognized by any nation) each span several regions and have no separate codes.
Based on the ISO registry, this appears to be correct. jVectorMap gives Somaliland the code XS; in the ISO registry defines, two-letter codes starting with X are "User-assigned code elements". Using XS for Somaliland appears to be safe in the context of jVectorMap, but there is no guarantee that other libraries or programs will use the same two-letter code.
Somaliland is not listed by the Nations Online Project either.
After visiting Somaliland, the journalist Joshua Keating, writing in The Guardian of 20 July 2018:
(...), according to the US Department of State, the United Nations, the African Union and every other government on Earth, I was not in Somaliland, a poor but stable and mostly functional country on the Horn of Africa. I was in Somalia.
(...)
As Somalilanders will often remind you, it was, in the past, an independent country, fully recognised by the international community, including the UN. But this halcyon period lasted less than a week. On 26 June 1960, the former Protectorate of Somaliland became fully independent from British rule, its independence recognised by 35 countries around the world, including the US. The next day, its new legislature passed a law approving a union with the south. On 1 July, Somalia became independent from Italy, and the two were joined together. It is a decision Somaliland has regretted almost ever since.
See also
25 years on, Somaliland struggles for recognition by Deutsche Welle, August 2016.
Why Somaliland is not a recognised state by The Economist, November 2015.
Somaliland's own recognition campaign.

Related

Transform a large list into a tibble with one column containing all elements [duplicate]

This question already has answers here:
Convert a list to a data frame
(26 answers)
Closed 3 years ago.
I'am sorry for this question because it seems quite obvious but I can't come up with a solution myself. I have a large list of 130 elements each a list of 10 single character strings.
I want to have this as a combined tibble with one column containing all strings.
If I try do.call(dplyr::bind_rows, y) on my list I still get an error: Error: Argument 1 must have names
For more insight about the list I will post the console output of the first sublist by calling dput(bribe.test[[1]])
dput(bribe.test[1])
list(list("\r\n Supercharge your R/C vehicle and also this systems will boost horsepower and performance of any RC nitro engines, visit us to get online xtm racing, xtm racing rail, xtm racing engine, xtm xt2 engine, and xtm nitro engine. Visit # https://rbinnovations.com/collections/super-chargers/xtm-racing\r\n ",
"\r\n The Powermatic 2+ or Powermatic 2 Plus Electric Cigarette Rolling Machine uses an electric spoon-fed cigarette injector that will make king size or 100's cigarettes in a few seconds and you can buy it online with us at Hard Working Products. Visit https://hardworkingproducts.com/powermatic-2\r\n ",
"\r\n Hello sir, My uncle just coming india yesterday night at ahmedabad airport from New Zealand. And i gave him 2 iphone , iphone 8 plus and iphone 11 pro.. and they called by custom department. The officer told him that they are not allowed with these phone. They force him to pay 42,000/- custom duty for these phone. He just arrived that's why they haven't got money at that time. But his son gave him 600 nzd for his expenses. And these bloody corrupt office force him to pay 600$. They felt helpless at that time and gave 600$ with the passport.My uncle dont know his name. You can check cameras if you want, he was at counter around 1:00 o'clock at night. It is bloody bad experience with them. I'm going to tell my friends and all the relatives which are here to not go india ever..\nI'm felling helpless to come my home country. If you can then take strict actions against these bloody corrupt officers who are cheating with our nation. Please take strict action. Hope you can save our nation from this corrupt officers\nSingapor airlines \nSQ530 arrived at 21:50 evening on 6/1/20\nThank you\r\n ",
"\r\n Date of the incident: 29th December 2019\nTime of incident: Around 8 PM in the evening\nPlace of incident: ECR road, Pondicherry to Tamil Nadu check post.\nWhile driving back from Pondicherry to our stay near ECR road, we (4 people in the car) took 8 beer cans of 500 ml each. At the checkpost (just 100mtrs before our lodge) police stopped us, started checking the vehicle. We voluntarily declared the beer quantity and handed over to them.\nThey asked us to pay Rs 4200 and go else, they will create a case on us and arrest us, seize the vehicle. Since we took the vehicle from self drive agency, we really wanted come out of this. We apologise to them as we weren't aware of the border lines between the states. Requested them to dispose the beers and let us go. My 5 year old daughter was crying seeing the officers are not allowing me to leave. Nothing was fruitful and we literally beg them to leave us. Language was a big barrier as we don't know tamil and none of the officers understand English/hindi properly. Somehow a communication happened and I had to show them the account balance online as I didn't have that much cash with me. Finally, the officer agreed to leave us with a cost of Rs 500 and 4 beer cans.\nWe noticed at the same time, 4 college students from chennai were also got caught with a bag full of Liquors. The officer was very casual to them and also denied money from them even though they offered him 200 rupees. They may be from families where the indian law does not get applied easily. I understand that.\nWe can't speak tamil or pondi language.. Is this what you are angry on us? Is this what you discriminate us? Don't you ruin the future of your own students in the name of partiality??\r\n ",
"\r\n Dear Sir,\nThis is not the first time I am facing this issue with Rohit Gas Agency. I tried to bring it to the notice of Indane. Its of no use. Rohit Gas Agency provides worst service. We do not have option. To Deliver the Cylinder, the Delivery boy demands Rs 50 everytime. This is a common issue. If not paid he shouts badly on road and moves out. Rohit Gas Agency is always unreachable. These bugs working in the Gas Agency are eating up the money paid by Gas Subscribers. \nMany a times, the cylinder is not delivered to home. We are forced to collect the Cylinder paying additional bribe of Rs 50 near Godown. If not paid, we need to lift the cylinder and carry the same back till the car parking and drive back home. \nThe Gas Delivery - Rohit Gas Agency is unfit to manage the delivery business. Please look into the complaints and reviews on google atleast. \nRegards\nPrashanth .P\r\n ",
"\r\n I paid bribe today to a police officer who came for passport verification of my mother. Even after providing all supporting documents and required information, officer asked to pay 500Rs for Chai Pani. When I asked to reduce the amount, officer said that it is decided by higher officials of police. \nI feel very bad after paying, this practice is so common in UP. Please take necessary actions against this to prevent civilians from such corrupt people. \nOfficer Name - Indrapal Singh\nThana - New Agra Police Station\nDate - 6th Jan 2020\nPlace - Agra\r\n ",
"\r\n I have asked to pay bribe to avoid huge penalty for putting tent sheet on car windows. Police asked me to pay 1100 rs fine or pay bribe instead of that. Since I don't had that much money and I was in urgency, I paid bribe to escape from the situation. This was happened at corporation circle church opposite to church at 12 30 PM. \r\n ",
"\r\n Help desk officer prashant who are trapping people to make work done by giving bribes to higher officials at malakpet rto malakpet Hyderabad \r\n ",
"\r\n Get free shipping when you buy the Revolution the great american electric cigarette machine, within the continental US from https://hardworkingproducts.com/revolution-electric-cigarette-machine-made-in-america and also you will get this machine at best market price in USA.\r\n ",
"\r\n I Would like to Inform you that a lot of corruption is going on in the DC Office Bangalore Urban Dept. I am not paid bribe directly there is lot more agents have to collect the money and some one has do the deel not direct deel with D C Officer. Brib agents collecting the money and send it to direct DC officer house. The Officer have a one more home office in Kumarakrupa road bangalore. the deeling files as going their for officer signature. One agent is doing his job in that office his name called Mahendre Kumar (Shift car No.KA 04 MK 282) Please do the action for this. Govt officers also been included in this deels and they get commission also.\nNames Sadanada Swamy , Basavaraju, G N Shivamurthy. \r\n "))
You could use unlist with tibble
df_tib <- tibble::tibble(col = unlist(bribe.test))
Or data.frame
df1 <- data.frame(col = unlist(bribe.test), stringsAsFactors = FALSE)

How to handle new time zone?

We have a database of cities with its geo coordinates. Once we filled it with corresponding time zones using tzworld. User sets location including city, city has time zone - here how we know user's timezone (we need to render date and time on server). But time zones are being changed: some new are appearing, some old are being removed.
Is there any best practices or tools to handle that kind of changes?
I.e. there is a city Foo with time zone Foo/Bar. One day tzdata was changed, and Foo/Bar was split into Foo/Old_Bar and Foo/New_Bar time zones with the same UTC offsets. We still have Foo/Bar in our db. Actually, it's a BC break, but it's ok since, say, we can handle those BC breaks. But then tzdata was changed again, and now Foo/New_Bar has different offset. And here comes troubles. Some users from Foo city see wrong local time since that moment.
Just to be sure you understand me right: it's not about DST, it's about the fact that time zones (their names) are being changed.
As far as I can see, wee need a kind of machine-readable tzdata diff. Like
split: Foo/Bar Foo/Old_Bar,Foo/New_Bar
move: Foo/New_Bar -05:00
This issue makes me feel that storing time zones is a bad idea. Is there a better one?
With specific regard to the IANA/Olson TZ database, the location identifiers do not change once established. The history of each identifier is always consistent for that location.
However, if you are using tz_world or some other map source to determine the time zone for some other location - one that doesn't necessarily have it's own identifier, then yes - it's possible that a zone split will cause the zone to change. Though, when it does, the new zone should be consistent with the old zone, up to the point of the change.
As a real world example, consider America/Fort_Nelson, which was added in tzdb 2015g for Fort Nelson, British Columbia, Canada, and the surrounding region of the Northern Rockies Regional Municipality. Previously, this area would have been resolved to America/Vancouver, but the zone was split due to their March 2015 time change. The tz_world maps were updated on November 7, 2015 to account for this change.
If you had previously resolved a user in Fort Nelson to America/Vancouver, then they will have incorrect times from November 1st, 2015 forward, as that's when Vancouver switched back to UTC-8, while Fort Nelson remained at UTC-7.
If you update to the latest tzdb and tz_world, you can use the original information to re-determine the time zone - which would now be America/Fort_Nelson.
The new time zone will accurately reflect all of the same information as Vancouver before the split, and the correct information for Fort Nelson after the split.
All of this should just work, assuming you update time zones after each update of tz_world, and recalculate future events after updating the tzdb.
The question remains, how do you know which zones have split and changed so you don't have to recalculate everything? For a small amount of data, you might as well recalculate everything. But for larger datasets, this might be impractical. Unfortunately, there's no machine-readable standardized format for the differences. I believe this has been talked about before in the tz discussion list, but I can't find it at the moment. You can ask there if you like.
Currently the only way is to manually read the release notes of each update. You can find them in the tz-announce list archives (or subscribe to the list for future updates). You can also find them in the NEWS file of any given release. You'll also want to review the history of the tz_world shapefile, which is on that web site.
Also, recognize that time zone IDs will never be removed from the tzdb. A split may create a new zone (Foo/New_Bar), but the original zone will remain (Foo/Bar, not Foo/Old_Bar). If a zone is determined unnecessary, its Zone entry might be replaced with a Link entry, but it will never be removed entirely.

Bypass Style Formatting when Parsing RSS Feed in R

I am trying to scrape and parse the following RSS feed http://www.nestle.com/_handlers/rss.ashx?q=068f9d6282034061936dbe150c72d197. I have no problem to extract the basic items that I need (e.g., title, description, pubDate) using the following code:
library(RCurl)
library(XML)
xml.url <- "http://www.nestle.com/_handlers/rss.ashx?q=068f9d6282034061936dbe150c72d197"
script <- getURL(xml.url)
doc <- xmlParse(script)
titles <- xpathSApply(doc,'//item/title',xmlValue)
descriptions <- xpathSApply(doc,'//item/description',xmlValue)
pubdates <- xpathSApply(doc,'//item/pubDate',xmlValue)
My problem is that the output for item "description" includes not only the actual text but also a lot of style formatting expressions. For example, the first element is:
descriptions[1]
[1] "<p><iframe height=\"322\" src=\"https://www.youtube-nocookie.com/embed/fhESDXnlMa0?rel=0\" frameBorder=\"0\" width=\"572\"></iframe><br />\n<br />\n<p><em>Nescafé</em> is partnering with Facebook to launch an immersive video, pioneering new technology just released for the platform.</p>\n<p>\nThe <em>Nescafé</em> <a class=\"externalLink\" title=\"Opens in a new window: Nescafé on Facebook\" href=\"https://www.facebook.com/Nescafe/videos/vb.203900255471/10156233581755472/?type=2&theater\" target=\"_blank\">‘Good Morning World’ video</a> stars people in kitchens across the world, performing the hit song ‘Don’t Worry’ using spoons, cups, forks and a jar of coffee. Uniquely, viewers can rotate their smartphones through 360˚ to explore the video, the first time this has been possible on Facebook.</p>\n<p>\n“We know young coffee lovers pick up their phone at the start of every day looking to be entertained by real experiences. The 360˚ video allows us to be engaging in an innovative way,” said Carsten Fredholm, Senior Vice President of Nestlé’s Beverage Strategic Business Unit.\n</p>\n<p><em>Nescafé</em> recently teamed up with Google to offer the first virtual reality coffee experience through the <em>Nescafé 360˚</em> app. It also became the first global brand to move its website onto Tumblr, to strengthen connections with younger fans by allowing them to create and share content.</p>\n<p>The Nestlé brand is one of only six globally to partner Facebook for the launch of this technology.</p></p>"
I can think of a regex approach to replace the unwanted character strings. However, is there a way to access the plain text elements of item "description" directly through xpath?
Any help with this issue, is very much appreciated. Thank you.
You can do:
descriptions <- sapply(descriptions, function(x) {
xmlValue(xmlRoot(htmlParse(x)))
}, USE.NAMES=FALSE)
which gives (via cat(stringr::str_wrap(descriptions[[1]], 70)):
In a move that will provide young Europeans increased access to
jobs and training opportunities, Nestlé and the Alliance for YOUth
have joined the European Pact for Youth as founding members. Seven
million people in Europe under the age of 25 are still inactive -
neither in employment, education or training. The European Pact for
Youth, created by European CSR business network CSR Europe and the
European Commission, aims to work together with businesses, youth
organisations, education providers and other stakeholders to reduce
skills gaps and increase youth employability. As part of the Pact, the
Alliance for YOUth will focus on setting up âdual learningâ schemes
across Europe, combining formal education with apprenticeships and on-
the-job training to help match skills with jobs on the market. The
Alliance for YOUth is a group of almost 200 companies mobilised by
Nestlé to help young people in Europe find work. It has pledged to
create 100,000 employability opportunities by 2017 and has already met
half of this target in its first year. Luis Cantarell, Executive Vice
President for Nestlé and co-initiator of the European Pact for Youth,
said: âPromoting a cultural shift to dual learning schemes based on
business-education collaboration is at the heart of Nestléâs youth
employment initiative since its start in 2013. The European Pact for
Youth will help to build a skilled workforce and will tackle youth
unemployment.â Learn more about the European Pact for Youth and read
their press release.
There are \n characters at various points in the resultant text (in almost all the descriptions) but you can gsub those away.

Date on website

I am building a website which will be viewed in UK, USA, and Europe, and want to know the best short date format to use.
I have been reading http://www.w3.org/QA/Tips/iso-date which reads...
*The international format defined by ISO (ISO 8601) tries to address all these problems by defining a numerical date system as follows:
YYYY-MM-DD where YYYY is the year [all the digits, i.e. 2012]
MM is the month [01 (January) to 12 (December)]
DD is the day [01 to 31]
For example, "3rd of April 2002", in this international format is written:
2002-04-03.*
...but still think that leaves room for error. The best I have seen is the BBC website uses "Thursday, 30 July" for example. Any suggestions?
Also, are there any Wordpress plugins that will handle this for me?
Ive used this plugin before https://wordpress.org/plugins/date-and-time-widget/screenshots/ which worked well (site is down now).
I agree with Zdeněk Šimůnek that you don't need the year. This plugin caters for all outputs really well.
If you want to manually add it with php, this is a good tutorial http://www.cyberciti.biz/faq/howto-finding-current-date-time-in-php/.
The BBC style is by me the best. If you were to write the month in number you would come to situation, where viewers in Europe would think that its for example 1st of February and in USA 2nd of January. Year is not needed as almost everybody knows what year it is. The day of the week is optional.
PS.: Many sites also writes a name day for current datum.

can 2 timezone be for 1 city?

I want to know if there can be 2 or more GMT timezones for one city or state. I know there can be more then one GMT timezone for a country, but not sure if it's for state and city too. Share your knowledge please.
Interpreting the question to mean 'are there any cities which are in more than one time zone', then the answer is 'yes'. And there are American states with multiple time zones (Indiana and Arizona being two of them).
There has been recent discussion on the TZ mailing list about the area of China known as Xinjiang, which has a mixed population of Han Chinese and of Uyghurs. It seems that the Han use the standard Chinese time zone (Asia/Beijing), but the Uyghurs often use a local time zone. This is now encapsulated in the Olson database, with the name Asia/Urumqi for the Uyghur time zone.
So, for example, the zone.tab file in tzdata2010b.tar.gz, available from ftp://elsie.nci.nih.gov/pub/tzdata2010b.tar.gz (the code is ftp://elsie.nci.nih.gov/pub/tzcode2009t.tar.gz). There is an extensive description of how and why the change was made in the asia file.
Note that the Olson (Time Zone) database is now (2016-09-19) available from IANA at https://www.iana.org/time-zones rather than from NIH. You can get the current release easily enough; getting historical releases may be harder.
Yes, time zones really do change 20 times a year around the world, and sometimes at essentially no notice (that is, the government legislates the changes only a day or two before the change).
#basit asks:
Wow about the 20 times a year around the world. I'm trying to log the timezone for latitude and longitude, so now my question would be, how long should I log the data for? 6 months? 1 month? 2.. 3..?
And also, how long does it take for daylight savings to change in a year, because I need to log timezone with daylight saving and refresh the data after certain given period.
What I mean is that during the course of 2009, there were 20 issues of the time zone database, because of changes in rules in at least that many places. However, any given country usually only changes their rules once - though with Argentina, different states were changing their rules at different times and compounding the problems.
I'm not clear that we have enough information to tell you how long to log the data for. I'd be inclined to say at least 12 months, but it depends what you are going to do with it. At one level, all you need to do is keep up with the Olson database - that will tell you the time zone rules for essentially everywhere in the world. If you are interested in tracking the time zones of your visitors, then you can keep the data for as long as you like. Since not everyone uses the canonical Continent/City notation for their time zone (I tend to use the older US/Pacific notation, for instance - which is still supported, but is equivalent to America/Los_Angeles). The classical notations such as TZ=EST5EDT are ambiguous; both the USA and Australia have timezones that use EST as an abbreviation, and the dates when the switch between standard and daylight saving time occurs varies (witness the mass of data in the Olson database).
You also ask 'how long does it take for a time zone to change'. I'm not sure what you mean. In terms of 'when the clocks change (between standard and daylight saving time)', it is 'instantaneous'; one second it is one time zone offset; the next second it is the other. If you mean 'how long does it take for governments to change their mind', it varies radically. For example, both Europe and the USA have relatively fixed rules that change every few years; the rule in the USA had been stable for about 20 years, then they changed the rules about 3 years ago. Europe is similar. On the other hand, some countries change their rules yearly. My impression is that some of the Islamic countries adjust when they switch between standard and daylight saving time (or vice versa) depending in part on when Ramadan falls - if the change would occur during Ramadan, then they bring it forward, or delay it, so that the rule does not change during Ramadan. Other countries have different reasons for the brinksmanship that goes on - maybe it is the political equivalent of a release deadline. So it may take quite a while for people to decide what the 'final' (meaning 'next edition') of the rules will be for a given year.
The web site http://worldtimezone.com/ does a pretty good job of keeping track of most of these idiosyncracies.
I think you mean "Can one city or state span two time zones?". Yes. Mexico Beach, FL sits on the border between CST and EST with parts of the town in both time zones.
As for how you could tell a computer that, no idea.
There is only one gmt for the whole world. As for timezones, see here, showing variation of observance e.g. within Kansas.
Any arbitrary jurisdiction may have multiple timezones, though the majority do not.
Have a look at http://www.worldtimezone.com/faq.html

Resources