Get the region name in maxmind database - database

I have downloaded a database cities
`Country` `City` `AccentCity` `Region` `Population` `Latitude` `Longitude`
af amir kalay Amir Kalay 16 0 34.6333 70.3333
ad aixas Aixas 06 0 42.4833 1.4667
and lot more records
I have downloaded another database called fips_10_4 to show the state of the city
country,Region,State
AD,02,"Canillo"
AD,03,"Encamp"
AD,04,"La Massana"
AD,05,"Ordino"
AD,06,"Sant Julia de Loria"
AD,07,"Andorra la Vella"
AD,08,"Escaldes-Engordany"
AE,01,"Abu Dhabi"
Now if you are thinking that Iam asking for some sql query then you are wrong.
Everything was working fine but then I came to know that the file i downloaded from
Maxmind website is incomplete as 'fips_10_4' has no record for country 'af' and region '16' .May anybody help me to deal this problem and tell me the correct place to download this complete file

FIPS 10-4 has changed. The list of changes can be found here.
In particular, AF16 (Laghman) has changed to AF35. MaxMind uses the new list.
If you need both the old and the new codes, you can find them here. You can parse the contents of the file, and replace your database table with the information found there.

AF is the two digit ISO code (IS0-3166-2) for Afghanistan, which ISO are currently trying to sell for the frankly astonishing sum of CHF 244 (Swiss Francs).
As Teleo says FIPS 10-4 has changed as detailed on the ITL website and the link Teleo has given provides the data in a more usable format. MaxMind also provides it in a better format.
I would be extremely wary about using this. Both MaxMind & Teleo's link are being provided, for free, by an external company/person that has no particular interest in keeping their data up-to-date. I notice, for instance, that the following countries are missing:
South Sudan
Sint Martaan (Dutch Part)
Bonaire, Sint Eustatius and Saba
Curaçao
The last three were part of the Netherlands Antilles, which was dissolved on 10th October 2010. Incidentally, the Netherlands Antilles, which hasn't existed for a year and a half, is still on this file.
The reason for all of this? FIPS 10-4 was withdrawn almost a decade ago on 8th September 2002. To quote the ITS website (my emphasis):
“For a replacement to FIPS 10-4, INCITS L1 is coordinating with other
standards developers and interested parties to determine whether
processing a draft proposed American National Standard or adopting an
ISO standard would be the better way forward. For more information on
the status of this activity, contact Rick Pearsall
(Richard.A.Pearsall#nga.mil).”
A quick Google brings the news the INCITS L1 is next meeting on the 12th June 2012. I wouldn't hold your breath.
Another reason not to use FIPS is that it is unlikely to be used much outside of the USA (obviously some people will still use it). While this may not matter immediately I would future proof your systems as a matter of course.
I would highly recommend using the ISO 3166 standard. It is a globally recognised way of categorising country data.
The CommonDataHub maintains a great version, which includes country and state in the same manner as FIPS 10-4. They also have other ISO states databases, which are more normalised and worth investigating.
It also maintains a list of all cities with a population greater than 5,000.
ISO maintain a copy on their website of the 3166-2 standard, which will take a bit of coding to ensure it's you're always updated at least you'll be sure it's correct. Wikipedia is also surprisingly good at keeping up-to-date. It beat CommonDataHub by a month when South Sudan was created, due to problems telling people that the data existed.
There are other places out there where this data exists, this just details what I use.
If you want to avoid databases all-together then the Yahoo! PlaceFinder API is a good place to start. It has some documented problems keeping up-to-date but at least there's a place where you can tell them they've got it wrong.
tl;dr
Don't use FIPS, it was withdrawn a decade ago. Use the globally recognised ISO standard instead.

I am not sure what is your true goal, but here is a great resource of countries and cities and all...

Related

Multiple language (but same value) count in Laravel

My Goal: To find out which University has the larger amount of user (DISTINCT and COUNT in MySQLi).
I've been developing a survey website for Portugal, England and France.
In the survey some questions answer has predefined answer options.
For example: Gender, Living Country, Graduation Level (undergraduate, graduate, PhD, BBA etc)
But I also have questions where users need to write down the answers.
For example, University Name (where the user studied).
Two users filled the form as follow:
In this case the text "University of Glasgow" in English and the text "Universidade of Glasgow" in Portuguese is difference but it's the same institute.
So, these two institute has one user but the truth is this (as both are originally same University) University has two users.
My Question: How can I get the expected result?
I was planning to use Google translate but I it won't be accurate.
I also thought about to have all the University name in 3 languages but there are more than thousands of University, so it may not be efficient.
The structre I thought for table is,
survey_table
id, que_en, que_fr, que_pt, university_name
statistics_table
id, university_name, count
You could use localization for the university name. Check the docs here:
https://laravel.com/docs/5.7/localization
Make your users choose from a drop down list based on their locale (language)

User Profile: Birthday VS Anniversary

I am creating a contact list and as usual I like to see how others do it. I went to see full-contact and they have 2 fields on the users profile, one for birthday and another for anniversary.
I thought that they where the same, but apparently they are not.
Does anyone knows the difference between he two?
If you know why, then why is that full-contact is using both?
Which one should I use?
Usually the "Birthday Represent the date of birth while the "Anniversary" represents the day of marriage.

MS Access 2010 database

I am not sure if this the proper forum for my kind of question but since you all guys are programmers perhaps you know a bit of everything. :)
So what I want to do is to create in MS Access a simple contact database (for my clients). BUT I want for each of my contacts (AKA records) to be able to add info assigned to dates (something like subform-record I guess) one info (note) assigned to one date for each record/client
Example:
Record 1: Bill Smith.
Date 17/02/2012 note: "I got 30$"
Date 18/05/2012 note: "I got 30$"
Record 2: Spencer Williams.
Date 17/02/2012 note: "I got 30$"
Date 18/05/2012 note: "I got 30$"
Date 19/05/2012 note: "I got 30$"
and so on...
notice that different records will give me info in the same dates sometimes.
In conclusion I wanna make a contact database for my clients but since I am having regular dates with them I want to take notes for each client : "what date" , "how much he gave me".
in case you are new comer in ms access world, I recommended to look at ready to use template. That can be downloaded from Microsoft site. For example : microsoft templates
in this et of template there is contact database

Is there a "standard" dataset for music in symbolic form? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
For music data in audio format, there's The Million Song Dataset (http://labrosa.ee.columbia.edu/millionsong/), for example. Is there a similar one for music in symbolic form (that is, where the notes - not the sound - is stored)? Any format (like MIDI or MusicXML) would be fine.
I'm not aware of a "standard" dataset. However, the places I know of for music scores in symbolic form are:
The Mutopia Project, a repository for free/libre music scores in Lilypond format. They standardise on Lilypond because it is a free/libre tool, it produces high-quality scores, and it’s possible to convert from many formats into Lilypond. They currently host over 1700 scores.
The aforementioned Gutenberg Sheet Music Project, an interesting one to watch. It hosts less than 100 scores now. However, it’s an offshoot of the tremendously successful Gutenburg Project for free ebooks (literature in plain text form), so they know how to run this sort of project. They have an excellent organised approach to content production.
MuseScore, a repository for music arrangements. They prefer MuseScore's own .mscz format, but support many others. [Added December 2019]
Wikifonia, a repository for lead sheets of songs. [As of December 2019, this site announces that it has closed.] A lead sheet is a simplified music score, perhaps enough to sing at a piano with friends, but not enough to publish a vocal score. They use MusicXML as their standard format. I estimate they have over 4000 scores. Interestingly, they have an arrangement to pay royalties for music they host. This is probably the best home for re-typeset scores of non-free/libre music. [This site was in operation in January 2012, when the answer was first written, but has ceased operation by December 2019, when this edit was made. Since the question is also old and closed, it's worth leaving this legacy entry in the answer.]
You can find a list of sites with sheet music in MusicXML and MusicXML-compatible formats at:
http://www.recordare.com/musicxml/music
Many of those sites include MIDI files and other formats as well.
KernScores is a really good collection. It has a section for people looking for datasets with > 10,000 monophonic pieces and other categories.
Edit: It also allows you to download whole sections at a time, zipped, which is a huge benefit when you don't want to have to click every individual download link.
The Sheet Music Project at www.gutenberg.org looks like what you're looking for. It uses MusicXML.
If by dataset you mean music collection, this music search engine is very effective:
http://www.kooplet.com/cgi-bin/kooplet/search.pl
There is the classical music MIDI dataset: http://www.piano-midi.de/
And more generally you can find 4 standard midi (and piano-roll) datasets which have been used to train neural networks here: http://www-etud.iro.umontreal.ca/~boulanni/icml2012
The datasets are:
Piano-midi.de(1) : Source (124 files, 951 KB) or Piano-roll (7.1 MB)
Nottingham(2) : Source (1037 files, 676.1 KB) or Piano-roll (23.2 MB)
MuseData(3) : Source (783 files, 3.0 MB) or Piano-roll (30.1 MB)
JSB Chorales : Source (382 files, 210 KB) or Piano-roll (2.0 MB)
(1)Please see the Copyright page. (2)The original collection is also
available in ABC format. (3)Please read the License Agreement.
State of the Art results on these datasets are reported here:
http://www-etud.iro.umontreal.ca/~boulanni/ICML2012.pdf

How many address fields would you use for a UK database?

Address records are probably used in most database, but I've seen a number of slightly different sets of fields used to store them. The number of fields seems to vary from 3-7, and sometimes all fields are simple labelled address1..addressN, other times given specific meaning (town, city, etc).
This is UK specific, though I'm open to comments about the rest of the world too. Here you need the first line of the address (actually just the number) and the post code to identify the address - everything else is mostly an added bonus.
I'm currently favouring:
Address 1
Address 2
Address 3
Town
County
Post Code
We could add Country if we ever needed it (unlikely).
What do you think? Is this too little, too much?
The Post Office suggests (http://www.postoffice.co.uk/portal/po/content1?catId=19100182&mediaId=19100267) 7 lines:
Addressees Name
Company/Organisation
Building Name
Number of building and name of thoroughfare
Locality Name
Post Town
Post Code
They then say you do not need to include a County name provided the Post Town and Postcode are used.
The BSI have BS 7666 - that covers all addressing. I recommend you look there.
The 2000 version recommends
An address shall be based upon a logical data model comprising the following entities:
addressable object, with sub-types:
primary addressable object;
secondary addressable object;
street;
locality;
town;
administrative area, a.k.a. district;
county;
postcode.
See: http://landregistry.data.gov.uk/def/common/BS7666Address
I don't know whether this is minimal (I doubt it) but the heading on my cheque book says something pretty close to:
Lloyds TSB
Isle of Man Offshore Centre
Peveril Buildings
Peveril Square
Douglas
Isle of Man
IM99 0XX
United Kingdom
This causes fits when I try to enter it into the US banking system.
If I were you, I'd call Royal Mail and ask them... or look on their website for postcode lookup as a best practice.
There's different types of addresses, and each different type has a slightly different structure. Forward sorting offices have a different postal address structure than a residential home with a street number. What if the house has a name instead of a number? There are so many factors to consider.
Since I moved to Canada I had to do something similar and it's far more complicated than a straightforward residential address which generally has:
Street Number if applicable
Street Number Suffix if applicable
House Name
Street Name
Street Type
Street Direction if applicable
Unit Number for flats, townhouses or other types of building/location
Minor Municipality (Village)
Major Municipality (Major Town/City)
County
PostCode
Country if you include Scotland, Wales, Northern Ireland (and now I noticed Eire)
Then you get businesses that have their own Delivery Route, PO Boxes, Forward Sortation Offices...
It gets complicated in a real hurry.
Best bet - give Royal Mail a call and they should be able to give you information on their standard address templates.
EDIT: Your 3 field method isn't a bad one...particularly. However, data sanitization may be a significant issue using the field setup you have and you may need a fairly complex strategy for making sure that the address entered is valid. It's far easier to sanitize single dedicated fields to make sure input is correct than it is to parse various address tokens out of combined fields.
Another simpler way to gain this info is to go on the Royal Mail website and check their postcode lookup page.
On their main postcode lookup, they use 4 fields and I guess they have some form of validation on the street name/type field. They separate the house number and name and I guess they only allow major municipality. I'm assuming the county/country are assumed. If you break out their advanced search, they give you two extra fields for flat number and business name.
Given that some fields are combined on their site, you have to assume that there's some amount of validation to make sure that data entered can be gainfully used.
Premises elements
Sub Building Name
Building Name
Building Number
Organisation Name
Department Name
PO Box Number
Thoroughfare elements
Dependent Thoroughfare Name
Dependent Thoroughfare Descriptor
Thoroughfare Name
Thoroughfare Descriptor
Locality elements
Double Dependent Locality
Dependent Locality
Post Town
Postcode element
Postcode
This answer may be a few years late, but it's aimed at those like myself looking for guidance on how to correctly format postal addresses for both storing in a database (or the likes of it) and for printing purposes.
Taken from Royal Mail Doc, link below - conveniently titled the 'Programmers Guide'
Technical specififcation for users of PAF
Page 27 - 42 was most helpful for me.
It's very likely that a "UK" will be opened to Eire as well, and in some lines of business there will be legal differences, generally between Scotland / NI / the channel islands and England and Wales.
In short, I would add country to the list. Otherwise it's fine (no fewer certainly), though of course any address is traceable from a building reference, a post code and a country alone.
Where we live in France its just 3 lines:-
myname
village/location name
6 digit postcode followed by post town name in uppercase
Even from UK that's all that is required

Resources