Search Results

Search found 1854 results on 75 pages for 'country'.

Page 5/75 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Free country/city suggestion list/database

    - by Ilian Iliev
    I'm looking for something similar to facebook suggestion list with cities and countries. You can see what I'm exactly talking about when you try to create new event in facebook, click to add address, and then start typing in the City field. I prefer finding working suggestion tool in jQuery(with the date), but database with city/country will do the trick too. Thanks in advance, Ilian Iliew

    Read the article

  • Any Reliable API available to determine User's city and country from IP address

    - by Gublooo
    Heyy guys I wanted to check if anyone knows of a reliable API that we can use to determine the user's city and country from his IP address. My search on Google led to http://ipinfodb.com/ip_location_api.php It seems perfect but my only concern is the reliability of this service. Does google have anything like this. If you know any other Free or paid API's that help determine user's location from his IP - please let me know THanks

    Read the article

  • Google's Geocoder returns wrong country

    - by 6bytes
    Hi I'm using Google's Geocoder to find lat lng coordinates for a given address. var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': address, 'region': 'uk' }, function(results, status) { if(status == google.maps.GeocoderStatus.OK) { lat: results[0].geometry.location.lat(), lng: results[0].geometry.location.lng() }); address variable is taken from an input field. I want to search locations only in UK. I thought that specifying 'region': 'uk' should be enough but it's not. When I type in "Boston" it founds Boston in US and I wanted the one in UK. How to restrict Geocoder to return locations only from one country or maybe from a certain lat lng range? Thanks

    Read the article

  • 2 sites each in a different country with 1 set of content (cloaking)

    - by Greg
    Hi, I have a question re: cloaking. I have a friend who has a business in Canada and the UK. Currently the .ca site is hosted on Godaddy. The co.uk domain is registered (with uk ip address) with domainmonster and is using a cloaked/framed redirect to the .ca site. As a result (my assumption) the .ca site is indexed fine by google, the .co.uk is not. The content is generic for both sites. How do I point the .co.uk site directly to the content independently (preferably without duplicating the content hosting in the UK), so that for instance if the .ca domain was taken away altogether the .co.uk domain would remain an entity in itself from Google's point of view? Does Google index a generic set of content and then associate different country domains with that content? I hope I have explained this ok. Thanks, Greg

    Read the article

  • UI Design - design pattern for city/country drop down? (ASP.NET MVC)

    - by JK
    What is the best way to do a city/country dropdown pair in ASP.NET MVC? I see lots of places with country above city, but that's unnatural: in real life we write city/country. I've used city, then country, but the problem is that the user then has to go backwards after changing the country. The other problem is what do you do about cities/countries not in your list? If city/country are both drop downs, then the user cant type their own city if it is missing. But if you have a dropdown and a textbox, that makes it unwieldy (you end up with 4 controls to enter 2 pieces of data). Are there any examples websites where the city/country dropdown pair are done in a very useable and clear manner?

    Read the article

  • Where does one get data like Country:(list) State:(list)

    - by rlb.usa
    As a programmer of data-entry forms of all kinds, I often find myself making fields for things like Country: <choose from list>, State: <choose from list>, Race/Ethnicity: <choose from list>. Consider: Perhaps a list the 50 United States names is an easy thing to find (does one include DC?) , but the countries are not. Nearly every site you find has a differing list with all of the political goings on over the years, and they become outdated quickly. What's the best/common practice regarding population of these kinds of lists? Where does this data come from if it's not given in the specs?

    Read the article

  • Regular expression for dividing country calling codes

    - by RickiG
    Hi I have a list of calling codes for all countries(the phone number prefixes), I would like to split them up in the country name and the actual code so I can put then into an xml. I have tried back and forth but can not get a regexp going that takes all cases into account. I think it is fairly simple for someone with a bit of experience. The codes have these formats: Afghanistan 93 Anguilla 1 264 Antarctica 6721 Antigua and Barbuda 1 268 Bosnia and Herzegovina 387 Canada 1 Congo, Republic of the 242 Cote d'Ivoire 225 Ireland (Eire) 353 United States of America 1 There are around 235 of them in total, but these are the regulars and the exceptions. ^[a-zA-Z]\s,'()] for between 1 and X words and then it is [0-9\s]{1,5}$ for the numbers: X XX XXX XXXX X XXX So if I should express it as a sentence it would be: "from beginning of a line, take all characters (1) including space,'() until you encounter digits, then take all of these including space(2) until you encounter a line break." I am using TextMate, and the docs says: TextMate uses the Oniguruma regular expression library by K. Kosako. I would appreciate any help given:) Thank you.

    Read the article

  • Building Queries Systematically

    - by Jeremy Smyth
    The SQL language is a bit like a toolkit for data. It consists of lots of little fiddly bits of syntax that, taken together, allow you to build complex edifices and return powerful results. For the uninitiated, the many tools can be quite confusing, and it's sometimes difficult to decide how to go about the process of building non-trivial queries, that is, queries that are more than a simple SELECT a, b FROM c; A System for Building Queries When you're building queries, you could use a system like the following:  Decide which fields contain the values you want to use in our output, and how you wish to alias those fields Values you want to see in your output Values you want to use in calculations . For example, to calculate margin on a product, you could calculate price - cost and give it the alias margin. Values you want to filter with. For example, you might only want to see products that weigh more than 2Kg or that are blue. The weight or colour columns could contain that information. Values you want to order by. For example you might want the most expensive products first, and the least last. You could use the price column in descending order to achieve that. Assuming the fields you've picked in point 1 are in multiple tables, find the connections between those tables Look for relationships between tables and identify the columns that implement those relationships. For example, The Orders table could have a CustomerID field referencing the same column in the Customers table. Sometimes the problem doesn't use relationships but rests on a different field; sometimes the query is looking for a coincidence of fact rather than a foreign key constraint. For example you might have sales representatives who live in the same state as a customer; this information is normally not used in relationships, but if your query is for organizing events where sales representatives meet customers, it's useful in that query. In such a case you would record the names of columns at either end of such a connection. Sometimes relationships require a bridge, a junction table that wasn't identified in point 1 above but is needed to connect tables you need; these are used in "many-to-many relationships". In these cases you need to record the columns in each table that connect to similar columns in other tables. Construct a join or series of joins using the fields and tables identified in point 2 above. This becomes your FROM clause. Filter using some of the fields in point 1 above. This becomes your WHERE clause. Construct an ORDER BY clause using values from point 1 above that are relevant to the desired order of the output rows. Project the result using the remainder of the fields in point 1 above. This becomes your SELECT clause. A Worked Example   Let's say you want to query the world database to find a list of countries (with their capitals) and the change in GNP, using the difference between the GNP and GNPOld columns, and that you only want to see results for countries with a population greater than 100,000,000. Using the system described above, we could do the following:  The Country.Name and City.Name columns contain the name of the country and city respectively.  The change in GNP comes from the calculation GNP - GNPOld. Both those columns are in the Country table. This calculation is also used to order the output, in descending order To see only countries with a population greater than 100,000,000, you need the Population field of the Country table. There is also a Population field in the City table, so you'll need to specify the table name to disambiguate. You can also represent a number like 100 million as 100e6 instead of 100000000 to make it easier to read. Because the fields come from the Country and City tables, you'll need to join them. There are two relationships between these tables: Each city is hosted within a country, and the city's CountryCode column identifies that country. Also, each country has a capital city, whose ID is contained within the country's Capital column. This latter relationship is the one to use, so the relevant columns and the condition that uses them is represented by the following FROM clause:  FROM Country JOIN City ON Country.Capital = City.ID The statement should only return countries with a population greater than 100,000,000. Country.Population is the relevant column, so the WHERE clause becomes:  WHERE Country.Population > 100e6  To sort the result set in reverse order of difference in GNP, you could use either the calculation, or the position in the output (it's the third column): ORDER BY GNP - GNPOld or ORDER BY 3 Finally, project the columns you wish to see by constructing the SELECT clause: SELECT Country.Name AS Country, City.Name AS Capital,        GNP - GNPOld AS `Difference in GNP`  The whole statement ends up looking like this:  mysql> SELECT Country.Name AS Country, City.Name AS Capital, -> GNP - GNPOld AS `Difference in GNP` -> FROM Country JOIN City ON Country.Capital = City.ID -> WHERE Country.Population > 100e6 -> ORDER BY 3 DESC; +--------------------+------------+-------------------+ | Country            | Capital    | Difference in GNP | +--------------------+------------+-------------------+ | United States | Washington | 399800.00 | | China | Peking | 64549.00 | | India | New Delhi | 16542.00 | | Nigeria | Abuja | 7084.00 | | Pakistan | Islamabad | 2740.00 | | Bangladesh | Dhaka | 886.00 | | Brazil | Brasília | -27369.00 | | Indonesia | Jakarta | -130020.00 | | Russian Federation | Moscow | -166381.00 | | Japan | Tokyo | -405596.00 | +--------------------+------------+-------------------+ 10 rows in set (0.00 sec) Queries with Aggregates and GROUP BY While this system might work well for many queries, it doesn't cater for situations where you have complex summaries and aggregation. For aggregation, you'd start with choosing which columns to view in the output, but this time you'd construct them as aggregate expressions. For example, you could look at the average population, or the count of distinct regions.You could also perform more complex aggregations, such as the average of GNP per head of population calculated as AVG(GNP/Population). Having chosen the values to appear in the output, you must choose how to aggregate those values. A useful way to think about this is that every aggregate query is of the form X, Y per Z. The SELECT clause contains the expressions for X and Y, as already described, and Z becomes your GROUP BY clause. Ordinarily you would also include Z in the query so you see how you are grouping, so the output becomes Z, X, Y per Z.  As an example, consider the following, which shows a count of  countries and the average population per continent:  mysql> SELECT Continent, COUNT(Name), AVG(Population)     -> FROM Country     -> GROUP BY Continent; +---------------+-------------+-----------------+ | Continent     | COUNT(Name) | AVG(Population) | +---------------+-------------+-----------------+ | Asia          |          51 |   72647562.7451 | | Europe        |          46 |   15871186.9565 | | North America |          37 |   13053864.8649 | | Africa        |          58 |   13525431.0345 | | Oceania       |          28 |    1085755.3571 | | Antarctica    |           5 |          0.0000 | | South America |          14 |   24698571.4286 | +---------------+-------------+-----------------+ 7 rows in set (0.00 sec) In this case, X is the number of countries, Y is the average population, and Z is the continent. Of course, you could have more fields in the SELECT clause, and  more fields in the GROUP BY clause as you require. You would also normally alias columns to make the output more suited to your requirements. More Complex Queries  Queries can get considerably more interesting than this. You could also add joins and other expressions to your aggregate query, as in the earlier part of this post. You could have more complex conditions in the WHERE clause. Similarly, you could use queries such as these in subqueries of yet more complex super-queries. Each technique becomes another tool in your toolbox, until before you know it you're writing queries across 15 tables that take two pages to write out. But that's for another day...

    Read the article

  • What is the best way to deal with address inputs that can be from multiple countries?

    - by Andrew.S
    Most of my websites in the past have been rather limited to the United States when it came to displaying addresses. On a project I'm working on right now, however, users can add events from all over the world. My problem is how to go about dealing with the different way in which addresses are displayed across the world. For example, City/State/Zip is just a US thing. I was figuring I would alter the inputs displayed based on the country selected but I have no idea how I'm supposed to know the way every single country does addresses. Ideas?

    Read the article

  • Google.com always forward me to google.com.hk

    - by Ta Coen
    Any one could help me to figure out why Google.com always forward me to google.com.hk? $ dig google.com www.google.com. 509426 IN CNAME www.l.google.com. www.l.google.com. 100 IN A 74.125.71.147 www.l.google.com. 100 IN A 74.125.71.99 www.l.google.com. 100 IN A 74.125.71.105 www.l.google.com. 100 IN A 74.125.71.106 www.l.google.com. 100 IN A 74.125.71.104 www.l.google.com. 100 IN A 74.125.71.103 and $ dig google.com.hk www.google.com.hk. 261572 IN CNAME www.google.com. www.google.com. 589217 IN CNAME www.l.google.com. www.l.google.com. 139 IN A 74.125.235.17 www.l.google.com. 139 IN A 74.125.235.18 www.l.google.com. 139 IN A 74.125.235.19 www.l.google.com. 139 IN A 74.125.235.20 www.l.google.com. 139 IN A 74.125.235.16 How to make my network always goes to google.com?

    Read the article

  • extension method phone format with country code as parameter

    - by frenchie
    Hi, I'm writing an extension method called ToPhoneFormat that formats a string of digits to phone numbers. Is it possible to add a parameter to the method that would enable me to call it like this: MyPhoneString.ToPhoneFormat(international code) That way, I could write MyPhoneString.ToPhoneFormat(1); to format a US phone number and MyPhoneString.ToPhoneFormat(33) to format a French phone number. I already wrote the method that does the formatting but I'm wondering how to build the constructor so that it works with a parameter when I'm calling it. Thanks.

    Read the article

  • Redirecting only if user asks for the root of the domain nad are froma particular country

    - by lphmedia
    Hi, I need a rule and condition to handle this scenario: User from US visits www.domain.com, domain.com, www.domain.com/ or domain.com/ this should be redirected to www.domain.com/usvisitor/ However, if a user from the US visits www.domain.com/anydirectory it will let them straight through without a redirection occurring. eg. RewriteEngine On RewriteBase / GeoIPEnable On GeoIPDBFile /var/share/GeoIP/GeoIP.dat RewriteEngine on RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^US$ RewriteCond %{HTTP_HOST} ^domain.com$ [L] RewriteRule ^/$ http://www.domain.com/usvisitor$1 [L] I know the RewriteConditons and rules are wrong - just can't get my head around it!

    Read the article

  • What approaches exist to setting up continent/country/city drop down menus?

    - by Dave
    How easy (or difficult) is it to have a Continent/Country/City drop down menu? Where one select from Drop Down Menus (for example): 1 - Europe 2 - UK 3 - London and then writes the Province/Area (for example: Essex). Realistically, how long should it take an experienced web developer to write the code of the above, as well as to link this selection to a Browse function and database storing? I do not have a geographical database yet and I am wondering what the fastest and cheapest way to add it to the drop down menu is. Is there any way to get that geographical database for free? I can see this type of geographical drop down menu in thousands of websites, but I am struggling as to how to implement it ASAP. Follow Up: Tks All x your answers and comments so far. I hear what you are saying. I understand that there are rare occasions of Countries with multiple (same) name Cities and that it might be disputable whether a Country belongs to a certain Continent/Region or not (see Russia x example, Europe or Asia?). Anyway, please take a look, for instance, at this website Sign UP screen http://www.couchsurfing.org/register.html My question then is: Where do I get that list (Country/Cities) and how do I create that _array? Manually copying it somewhere else (which would take me ages) or are there ready made lists that can be downloaded from somewhere for free?

    Read the article

  • Location detecting tecniques for IP addresses

    - by ilhan
    What are the location detecting tecniques for IP adresses? I know to look at the $_SERVER['HTTP_ACCEPT_LANGUAGE'] (not accurate but mostly useful to detect location, for example if an IP range's users set French to their browser then it means that this range) belongs to France and gethostbyaddr($_SERVER['REMOTE_ADDR']) (to look country code top-level domain) then may be to whois gethostbyaddr($_SERVER['REMOTE_ADDR']) sometimes: $HTTP_USER_AGENT (Firefox's user agent string has language code, not accurate but mostly can be used to detect the location) But what about cities?

    Read the article

  • How to use AJAX to populate state list depending on Country list?

    - by jasondavis
    I have the code below that will change a state dropdown list when you change the country list. How can I make it change the state list ONLY when country ID number 2234 and 224 are selected? If another country is selected is should change into this text input box <input type="text" name="othstate" value="" class="textBox"> The form <form method="post" name="form1"> <select style="background-color: #ffffa0" name="country" onchange="getState(this.value)"> <option>Select Country</option> <option value="223">USA</option> <option value="224">Canada</option> <option value="225">England</option> <option value="226">Ireland</option> </select> <select style="background-color: #ffffa0" name="state"> <option>Select Country First</option> </select> The javascript <script> function getState(countryId) { var strURL="findState.php?country="+countryId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('statediv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } </script>

    Read the article

  • PERL XPath Parser Help

    - by cognvision
    I want to pull in data using a XML::XPath parser from a XML DB file from the Worldbank site. The problem is that I'm not seeing any results in the output. I must be missing something in the code. Ideally, I would like to extract just the death rate statistics from each country XML DB (year and value). I'm using this as part of my input: http://data.worldbank.org/sites/default/files/countries/en/afghanistan_en.xml use strict; use LWP 5.64; use HTML::ContentExtractor; use XML::XPath; my $agent1 = LWP::UserAgent->new; my $extractor = HTML::ContentExtractor->new(); #Retrieve main Worldbank country site my $mainlink = "http://data.worldbank.org/country/"; my $page = $agent1->get("$mainlink"); my $fulltext = $page->decoded_content(); #Match to just all available countries in Worldbank my $country = ""; my @countryList; if (@countryList = $fulltext =~ m/(http:\/\/data\.worldbank\.org\/country\/.*?")/gi){ foreach $country(@countryList){ #Remove " at the end of link $country=~s/\"//gi; print "\n" . $country; #Retrieve each country profile's XML DB file my $page = $agent1->get("$country"); my $fulltext = $page->decoded_content(); my $XML_DB = ""; my @countryXMLDBList; if (@countryXMLDBList = $fulltext =~ m/(http:\/\/data\.worldbank\.org\/sites\/default\/files\/countries\/en\/.*?\.xml)/gi){ foreach $XML_DB(@countryXMLDBList){ my $page = $agent1->get("$XML_DB"); my $fulltext = $page->decoded_content(); #print $fulltext; #Use XML XPath parser to find elements related to death rate my $xp = XML::XPath->new($fulltext); #my $xp = XML::XPath->new("afghanistan_en.xml"); my $nodeSet = $xp->find("//*"); if (!$nodeSet->isa('XML::XPath::NodeSet') || $nodeSet->size() == 0) { #No match found print "\nMatch not found!"; exit; } else { foreach my $node ($nodeSet->get_nodelist){ print "\n" . $node->find('country')->string_value; print "\n" . $node->find('indicator')->string_value; print "\n" . $node->find('year')->string_value; print "\n" . $node->find('value')->string_value; exit; } } } #Build line graph based on death rate statistics and output some image file format } } } I am also looking into using the xpath expression "following-sibling", but not sure how to use it correctly. For example, I have the following set of XML data where I am only interested in pulling siblings directly after the indicator for just death rate data. <data> <country id="AFG">Afghanistan</country> <indicator id="SP.DYN.CDRT.IN">Death rate, crude (per 1,000 people)</indicator> <year>2006</year> <value>20.3410000</value> </data> - <data> <country id="AFG">Afghanistan</country> <indicator id="SP.DYN.CDRT.IN">Death rate, crude (per 1,000 people)</indicator> <year>2007</year> <value>19.9480000</value> </data> - <data> <country id="AFG">Afghanistan</country> <indicator id="SP.DYN.CDRT.IN">Death rate, crude (per 1,000 people)</indicator> <year>2008</year> <value>19.5720000</value> </data> - <data> <country id="AFG">Afghanistan</country> <indicator id="IC.EXP.DOCS">Documents to export (number)</indicator> <year>2005</year> <value>7.0000000</value> </data> - <data> <country id="AFG">Afghanistan</country> <indicator id="IC.EXP.DOCS">Documents to export (number)</indicator> <year>2006</year> <value>12.0000000</value> </data> - <data> <country id="AFG">Afghanistan</country> <indicator id="IC.EXP.DOCS">Documents to export (number)</indicator> <year>2007</year> <value>12.0000000</value> </data> Any help would be much appreciated!!!

    Read the article

  • Converting "fr_FR" into "French (France)" in both directions. (Objective-C iPhone)

    - by Janice
    I can easily change a short region-code (en_US) into a longer string... but it there an easy way to also move in the other direction? [displayInEnglish displayNameForKey:NSLocaleIdentifier value:regionCountryCode]; "en_US" becomes "English (United States)". "English (United States)" becomes "en_US". I currently store the short region-code in a database.... but when I show some aggregate results... I need to display the longer strings to the user. Or should I just store the longer strings right in the database... and not even worry about "converting" them later? I'm trying to show a "dollars total" for each country. If you were a user... which would you more likely wish to see (for a currency-total list)? A "French" total A "France" total A "French (France)" total A "fr_Fr" total?

    Read the article

  • How can I restore a country specific apt-get update mirror?

    - by ferrarimarco
    While configuring my new 13.10 installation, I chose to change the default update server using the "Software & Updates" GUI tool available in the System settings panel. Before this change the selected update server was "Server for Italy" (I live there). Now it's one of the mirrors available in the list of mirrors (one of italian ones). How is "Server for COUNTRY" chosen in the list of mirrors for a country? How can I restore the "Server for Italy" option? Is it advisable to do so? I want to revert that setting because I found that the selected mirror is not up to date (checked from Here).

    Read the article

  • Soccer Game only with National Team names (country names) what about player names? [duplicate]

    - by nightkarnation
    This question already has an answer here: Legal issues around using real players names and team emblems in an open source game 2 answers Ok...this question hasn't been asked before, its very similar to some, but here's the difference: I am making a soccer/football simulator game, that only has national teams (with no official logos) just the country names and flags. Now, my doubt is the following...can I use real player names (that play or played on that national team?) From what I understand if I use a player name linked to a club like Barcelona FC (not a national team) I need the right from the club and the association that club is linked to, right? But If I am only linking the name just to a country...I might just need the permission of the actual player (that I am using his name) and not any other associations, correct? Thanks a lot in advance! Cheers, Diego.

    Read the article

  • Django/jquery: Address forms - dyamically adding state drop down list if country is United States?

    - by User
    I have a django html form for address information. There is standard street, city, state/province, postal code, country fields. The country field is a drop down list. How can I make the state/province field a drop down list if the selected country is united states and a free form text box if the country is anything else? I'd prefer not to have to do a round trip to the server so probably through jquery?

    Read the article

  • Explicit casting doesn't work in default model binding

    - by Felix
    I am using ASP.NET MVC2 and Entity Framework. I am going to simplify the situation a little; hopefully it will make it clearer, not more confusing! I have a controller action to create address, and the country is a lookup table (in other words, there is a one-to-many relationship between Country and Address classes). Let's say for clarity that the field in the Address class is called Address.Land. And, for the purposes of the dropdown list, I am getting Country.CountryID and Country.Name. I am aware of Model vs. Input validation. So, if I call the dropdown field formLand - I can make it work. But if I call the field Land (that is, matching the variable in Address class) - I am getting the following error: "The parameter conversion from type 'System.String' to type 'App.Country' failed because no type converter can convert between these types." OK, this makes sense. A string (CountryID) comes from the form and the binder doesn't know how to convert it to Country type. So, I wrote the converter: namespace App { public partial class Country { public static explicit operator Country(string countryID) { AppEntities context = new AppEntities(); Country country = (Country) context.GetObjectByKey( new EntityKey("AppEntities.Countries", "CountryID", countryID)); return country; } } } FWIW, I tried both explicit and implicit. I tested it from the controller - Country c = (Country)"fr" - and it works fine. However, it never got invoked when the View is posted. I am getting the same "no type converter" error in the model. Any ideas how to hint to the model binder that there is a type converter? Thanks

    Read the article

  • Directing Multiple ccTLD's to 1 gTLD with a country specific subdirectory?

    - by Pascal Van Opzeeland
    We have multiple ccTLDomains and are thinking about how to best combine these into one. We want to do this to focus our link building efforts. We are running a website through which we offer a software-as-a-service. Therefore we could potentially sell to any country in the world. However, Germany is our most important market. We currently have a .com, .de, .nl. and .pl domain. All these domains have a high amount of unique content pages. What we are planning is to change everything to .com with language-based subdirectories, so .com/en/, .com/de/, etc. I have two questions concerning this issue: 1) How much of an advantage does a ccTLD have over a gTLD with country specific subdirectories in search rankings? So let’s say .de versus .com/de/? 2) How could we best redirect the visitors of our old ccTLD’s to our gTLD’s subdirectories? We would like to loose as few search engine rankings as possible. Thank you for your help.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >