stackexchange

Convert xml to json to process file into Bigquery

隐身守侯 提交于 2020-01-24 19:27:06
问题 I would like process a stackexchange raw data into BigQuery, but first the data use a 7z compress format, so I uncompressed the data to port this to gz format, but the internal file is a xml. So I need convert the file from xml to json. Any ideas? I used p7zip to uncompress and xml2json to try port the xml file but not work. <?xml version="1.0" encoding="utf-8"?> <comments> <row Id="1" PostId="1" Score="3" Text="We need to all post more questions. Last time, we kinda "rushed" to get a w hole

How to retrieve number of tags at a certain time in the past

我的未来我决定 提交于 2019-12-14 03:25:11
问题 I can see here how to get number of tags through StackExchange API. Is it possible to get number of tags at a certain time in the past? How can I run https://api.stackexchange.com/2.2/tags?order=desc&sort=popular&inname=java&site=stackoverflow with BigQuery? 回答1: One of potentially many options - for BigQuery Standard SQL #standardSQL SELECT tag, COUNT(1) AS popular FROM `bigquery-public-data.stackoverflow.stackoverflow_posts`, UNNEST(SPLIT(tags, '|')) AS tag WHERE DATE(creation_date) BETWEEN

Is there an alternative to parse_qs that handles semi-colons?

无人久伴 提交于 2019-12-09 13:37:03
问题 TL;DR What libraries/calls are available to handle query strings containing semi-colons differently than parse_qs? >>> urlparse.parse_qs("tagged=python;ruby") >>> {'tagged': ['python']} Full Background I'm working with the StackExchange API to search for tagged questions. Search is laid out like so, with tags separated by semi-colons: /2.1/search?order=desc&sort=activity&tagged=python;ruby&site=stackoverflow Interacting with the API is just fine. The problem comes in when I want to test the

Is there an alternative to parse_qs that handles semi-colons?

坚强是说给别人听的谎言 提交于 2019-12-03 15:22:17
TL;DR What libraries/calls are available to handle query strings containing semi-colons differently than parse_qs? >>> urlparse.parse_qs("tagged=python;ruby") >>> {'tagged': ['python']} Full Background I'm working with the StackExchange API to search for tagged questions. Search is laid out like so, with tags separated by semi-colons: /2.1/search?order=desc&sort=activity&tagged=python;ruby&site=stackoverflow Interacting with the API is just fine. The problem comes in when I want to test the calls, particularly when using httpretty to mock HTTP. Under the hood, httpretty is using urlparse.parse

OpenID Connect delegation with Google now that they are deprecating their OpenID2 provider?

强颜欢笑 提交于 2019-11-28 21:07:10
For years I have used OpenID delegation to log in to Stack Overflow (among other sites) using my own URI as OpenID but having Google handle the authentication. I use the technique described in this Stack Overflow question ; so, my custom OpenID http://tupelo-schneck.org/robert resolves to an HTML page containing this: <link href="https://www.google.com/accounts/o8/ud" rel="openid2.provider" /> <link href="https://www.google.com/profiles/schneck" rel="openid2.local_id" /> Now, however, I have logged into Stack Overflow and had Google tell me " Important notice: OpenID2 for Google accounts is

How do real time updates work?

我的未来我决定 提交于 2019-11-28 16:22:40
Now a days real time updates are common in most popular sites which have heavy usages. StackExchange Facebook Twitter I'm wondering how do these "real time updates" work? I'm just looking for a general bird's view perspective. I suspect that the JS can't be calling the server every X seconds for an update and then appending that to the <ul> . Is a notification sent from the server went to pull more content? Would be great if there is a simple how to article that explains this with a demo? Stack Overflow is using Web Sockets for real time updates. If you take a look in the source code (2012

How do real time updates work?

若如初见. 提交于 2019-11-27 19:55:17
问题 Now a days real time updates are common in most popular sites which have heavy usages. StackExchange Facebook Twitter I'm wondering how do these "real time updates" work? I'm just looking for a general bird's view perspective. I suspect that the JS can't be calling the server every X seconds for an update and then appending that to the <ul> . Is a notification sent from the server went to pull more content? Would be great if there is a simple how to article that explains this with a demo? 回答1

StackExchange.Redis - LockTake / LockRelease Usage

烈酒焚心 提交于 2019-11-27 18:23:24
I am using Redis with StackExchange.Redis. I have multiple threads that will at some point access and edit the value of the same key, so I need to synchronize the manipulation of the data. Looking at the available functions, I see that there are two functions, TakeLock and ReleaseLock. However, these functions take both a key and a value parameter rather than the expected single key to be locked. The intellisene documentation and source on GitHub don't explain how to use the LockTake and LockRelease functions or what to pass in for the key and value parameters. Q: What is the correct usage of

Difference between StackExchange.Redis and ServiceStack.Redis

大兔子大兔子 提交于 2019-11-27 15:39:43
问题 Someone can explain the difference about ServiceStack.Redis and StackExchange.Redis c# libraries? 回答1: It's VERY important to notice that ServiceStack is a commercially-supported product. See the free-quotas on servicestack.net. Also this question mentions the same. The ServiceStack.Redis NuGet package include the following limitations: 10 Operations in ServiceStack (i.e. Request DTOs) 10 Tables in OrmLite 20 Different Types in JSON, JSV and CSV Serializers * 20 Different Types in Redis