Live data from Hacker News

Poll: Where do you live?

news.ycombinator.com

301–310 of 563 posts

Re: Poll: Where do you live?

#301
post #223

Earlier quoted context omitted.

Current top 10: 'US: California' '79 points' 'Canada' '48 points' 'US: Washington' '39 points' 'US: New York' '36 points' 'Germany' '35 points' 'United Kingdom' '34 points' 'US: Massachusetts' '19 points' 'Netherlands' '18 points' 'US: Colorado' '17 points' 'Sweden' '16 points' Colorado #9? Really?

Can't we just aggregate all of the US or worth splitting out cities/states/provinces for other countries also.. Think it makes the point of even this forum being US centric

This forum is run by a US company and was originally made for their US portfolio.

Large US states are more populous than most countries, and the US tech industry is orders of magnitude larger than most countries'.

If US weren't broken out, it would be a huge outlier at the top and wouldn't be nearly as interesting.

I don't know of any other country that would make the chart that much more interesting by being broken up.

Re: Poll: Where do you live?

#302
post #154
post #25

Pasting this in dev console will give you a quick and dirty rundown. It sorts locations by points. [...document.querySelectorAll('.fatitem table .athing')].map(el => [el.textContent.trim(), el.nextSibling.textContent.trim()]).sort(([,a], [,b]) => parseInt(b) - parseInt(a)).map(a => a.join(' - ')) As of this post, California is leading, followed by other places w/ large tech hubs (Germany, UK, Canada, NY, Washington)

Would be interesting to see it expressed as a % of population as well to see HN density, as well as quantity.

I didn't get the data to do this globally, but here it is for the US (data from https://api.census.gov/data/2021/pep/population?get=POP_2021...*):

    const totalPop = {"Oklahoma":3986639,"Nebraska":1963692,"Hawaii":1441553,"South Dakota":895376,"Tennessee":6975218,"Nevada":3143991,"New Mexico":2115877,"Iowa":3193079,"Kansas":2934582,"District of Columbia":670050,"Texas":29527941,"Missouri":6168187,"Arkansas":3025891,"Michigan":10050811,"New Hampshire":1388992,"North Carolina":10551162,"Ohio":11780017,"South Carolina":5190705,"Wyoming":578803,"California":39237836,"North Dakota":774948,"Louisiana":4624047,"Maryland":6165129,"Delaware":1003384,"Pennsylvania":12964056,"Georgia":10799566,"Oregon":4246155,"Minnesota":5707390,"Colorado":5812069,"New Jersey":9267130,"Kentucky":4509394,"Washington":7738692,"Maine":1372247,"Vermont":645570,"Idaho":1900923,"Indiana":6805985,"Montana":1104271,"New York":19835913,"Puerto Rico":3263584,"Connecticut":3605597,"Florida":21781128,"Virginia":8642274,"Massachusetts":6984723,"Illinois":12671469,"Mississippi":2949965,"Arizona":7276316,"Utah":3337975,"Wisconsin":5895908,"Alabama":5039877,"West Virginia":1782959,"Rhode Island":1095610,"Alaska":732673};
    console.table(
      [...document.querySelectorAll('.fatitem table .athing')]
      .map(el => ({place: el.textContent.trim(), score: parseInt(el.nextSibling.textContent)}))
      .filter(el => el.place.includes("US:"))
      .map(el => ({...el, place: el.place.replace("US: ", "")}))
      .map(el => ({...el, totalPop: totalPop[el.place]}))
      .filter(el => el.totalPop != undefined)
      .map(el => ({...el, density: el.score / el.totalPop}))
      .sort((a, b) => b.density - a.density)
    )

Re: Poll: Where do you live?

#303
post #36
post #25

Pasting this in dev console will give you a quick and dirty rundown. It sorts locations by points. [...document.querySelectorAll('.fatitem table .athing')].map(el => [el.textContent.trim(), el.nextSibling.textContent.trim()]).sort(([,a], [,b]) => parseInt(b) - parseInt(a)).map(a => a.join(' - ')) As of this post, California is leading, followed by other places w/ large tech hubs (Germany, UK, Canada, NY, Washington)

This is begging for a console.table console.table([...document.querySelectorAll('.fatitem table .athing')].map(el => [el.textContent.trim(), el.nextSibling.textContent.trim()]).sort(([,a], [,b]) => parseInt(b) - parseInt(a)))

If you're on a mobile browser, paste this into the address bar:

    javascript:document.write('' + [...document.querySelectorAll('.fatitem table .athing')].map(el => ({place: el.textContent.trim(), score: parseInt(el.nextSibling.textContent)})).sort((a, b) => b.score - a.score || a.place.localeCompare(b.place)).map(e => `${e.place}${e.score}`).join('') + '')

Re: Poll: Where do you live?

#304
I think that places like APAC are going to be a little bit under represented because of the timing. As an example, it's currently 9am on a Saturday in Sydney Australia.

In US it's still Friday and people are at work, e.g. it's currently 2pm on a Friday in the West Coast of the US

Re: Poll: Where do you live?

#305
post #297

Earlier quoted context omitted.

As percent of total responses, as of right now: 'US: California', '10.87%' 'Canada', '5.79%' 'United Kingdom', '4.51%' 'US: Washington', '4.45%' 'Germany', '4.45%' 'US: New York', '4.32%' 'US: Colorado', '2.10%' 'US: Texas', '1.97%' 'US: Massachusetts', '1.84%' 'France', '1.78%' The US in total makes up 49% of responses so far (even though it is nearly 10pm in most of Europe) Edit: quick and dirty one-liner to get th…

Be mindful that the dataset is 1-indexed (i.e. zero votes equal a score of 1), so your script is probably a bit skewed towards non-US.

Good catch. Accounting for that brings the US up from currently 50.2% to 52.8%. It also brings California up from 11.75% to 12.86%. I updated my code above to account for that (having to fight the urge to refactor it to be more sensible)

Re: Poll: Where do you live?

#306
I'm afraid the difference in time zones means this post will be on the front at wildly different times in the day for different parts of earth, might quite heavily skew the results.

I guess you'll still be able to make your point though.

Re: Poll: Where do you live?

#307

Earlier quoted context omitted.

I suppose it's because the main issue is whether or not HN is "Silicon Valley", and so if you're in the UK (for example) you are not Silicon Valley regardless of if you are in NI, Scotland, Wales, or England.

In that case, may the poll should have been binary ? edit: typo

Actually, that's probably the reason - the poll was by binarynate not uknate.

Re: Poll: Where do you live?

#308
post #10

I hope there is someone who knows how to code in this community to parse the results and do a nice visualization. I have a cousin who knows about computers, if noone knows here how to do it, I can ask him to try. He always helps me with my printer.

https://wheredohnuserslive.vercel.app/ Visualized it by countries and us states. Should update every 30 seconds.

The US map is bigger than the rest of the world

Re: Poll: Where do you live?

#309

Earlier quoted context omitted.

I never understood the purpose of languages with unicode operators that can supposedly express a 30 line script in like 2 symbols. Are they purpose built on the spot for CodeGolf?

Not on the spot, a condition for the answer to be accepted is that the language must exist before the challenge, but yes, many languages exist only just for the purpose of golfing. Mathematica is a legitimate language though, it just is the case that some operations are surprisingly compact.

Like checking if an image is of a goat:

    ImageInstanceQ[x,"caprine animal",RecognitionThreshold->i/100]
https://codegolf.stackexchange.com/a/71680
Post reply on HN