« first day (3009 days earlier)      last day (1958 days later) » 
00:00 - 20:0020:00 - 23:00

wim
12:28 AM
Works perfect! Thank you very muchly.
 
 
2 hours later…
2:03 AM
@MartijnPieters I'm wondering if it's possible that you could extend your answer here to cover JSON-lines format? That is the #1 search result for that error and things like BigQuery deal in this format. All of the top JSON parse answers don't really account for the rise in this new(ish) format and I'm seeing questions about it daily, but their search is inevitably drowned out.
"that error" being json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0). With the rise of the format, it's becoming tell-tale of the \n breaking the formal JSON format
At the same time, the content of the question doesn't really match. Do we start from scratch with a new question/answer to address this? And, if so, how do we make it stand out for those in big data?
 
 
2 hours later…
4:17 AM
cbg
 
 
1 hour later…
5:25 AM
guys can anyone point out what exactly is going here

I tried to execute sql query in a dataframe using pandasql

transaction_product is dataframe

query="""select productid,ProductName, sum(Value) as Price,
sum(Value)-sum(DiscountPrice) as Profit
from transaction_product
where CardNo is not null and ProductName is not null and Value>1
group by ProductId;
"""

pysqldf = lambda q: sqldf(q, globals())
profit=pysqldf(querry)

after executing the query this error is appearing

pandasql.sqldf.PandaSQLException: (sqlite3.OperationalError) no such table: transaction_product [SQL: 'select productid
 
 
3 hours later…
8:29 AM
cbg o/
 
 
1 hour later…
9:59 AM
dbg
 
cbg
 
10:56 AM
guyz can anyone suggest a good name for an E-commerce site
 
buy-ton.com
 
11:17 AM
@AkhilAlexander surprisingly shutupandtakemymoney.com is already taken, so I'm out of ideas..
 
@PeterVaro hey, long time no see here. How are you?
 
hey matey, I'm always around I just became quite passive on SO lately (== for the last 2+ years)
anyway, I've never been better, how's yourself?
 
Fine, thanks :)
glad to hear you're doing great
 
the only thing I could complain about is the newest DW season (wink @JonClements)! it was even worse than the last 4 seasons.. and it essentially made me stop watching the show..
(maybe you guys already talked about this, dunno, but I'm interested in any opinions on the show, let me know how other's feel about it)
 
DW?
 
11:28 AM
oh sorry, yeah, Doctor Who
 
Ohh :D Nope haven't seen it!
 
at all? or you just missed the newest series?
 
@roganjosh Wow, not sure how Google thinks that's a good post for JSON Lines. I have stackoverflow.com/questions/12451431/… for that format.
 
Haven't seen it at all. I've heard about it though
 
well, I can only recommend the first 6, maybe 7 seasons (of the new era ofc)
 
11:31 AM
@PeterVaro nah, things have been quiet
 
I do think Jody Foster is doing a good job.
 
@MartijnPieters JF o.O ? :D
 
I have mixed feelings about the stories and execution.
Erm, brain scramble.
 
hehe
aparently Jodie Whittaker was named after Jodie Foster, so it checks out
 
the same here! she is an awesome actress -- she just has nothing to work with (script/story-wise)
 
11:33 AM
I've heard that she is great and the story isn't
 
@AndrasDeak nfw, are you sure?
she is not that great so far as a Doctor IMO, but all in all she is a fab actress
 
It's a typical feature of my brain make-up. I can remember, in fine detail, how computers work, but names always get mixed up.
 
> Jodie Whittaker, who plays the Thirteenth Doctor, was named after Jodie Foster.[source needed]
it's as reliable info as the word of a random editor on wikia
alarming lack of Jodie Fosters (Jodies Foster?) on Whittaker's wikipedia page
 
@MartijnPieters well luckily, you got paid for the former not the latter! :)
 
11:50 AM
@PeterVaro I think like Peter, Jodie has been wasted by subpar writing... :(
Heh... your display image looks a bit like Dr Robotnik :)
 
@MartijnPieters I think that this is quite a fascinating area. How programming shapes the brain. And I noticed this tendency as well
 
@Hakaishin it's not the programming that shaped my brain that way, though.
 
@Martijn I can meet someone - remember their car number plate and phone number off the top of my head... but occasionally completely forget their name :)
 
I lose about 50% of names quite literally after a single line of conversation after the introduction :/
 
This is one of my big fears that I got to a party with people I've known for 10+ years and on the way there I still have to recall all the names to make sure I got them down :D
 
12:04 PM
ripe for duplicate killing: google.com/…
 
@roganjosh that's okay mate.... (using mate placeholder while trying to remember name... :p)
 
If I'm lucky, they share a name with someone I already know, and I have to quickly set up a link between the two people until the name has stuck. I'll still know their face after 10 years though if we ever bump into each other. Weird.
@JonClements hey, that's my trick!
At school we were given a weird task in maths class. Memorise as many digits of pi in 1 minute as you could (I think it was for chocolate at end of term or something). Still got it to 20 d.p. in my head :P
 
Neat... I can go well beyond 20.... do the dp's need to be in the right order though as I know what digits appear in it :)
 
Alas, order is indeed important
 
Cabbage
 
12:11 PM
cbg
 
Cabbage!
How is everyone?
 
stuck debugging as usual
 
Sounds like fun
 
12:43 PM
cabbagecabbage
 
cbg
 
ugh, chat.SO and chat.SE and chat.MSE have all been crapping out for me for almost an hour
I might not be back for a while if the issue comes back
 
1:03 PM
aaaand it's gone :D
 
odd... chat generally seems more resilient that the main site at times :)
 
Yeah used to be for sure :D
Hi Jon
 
1:18 PM
the worst part is nobody else seems to be affected, including a fellow Hungarian
 
1:36 PM
@Катерина howdy
 
btw what do you guys do against very cold hands when programming?
It is a real pain
 
I stop programming and go fetch a coffee
 
Insert link here to the "I'm cold, so I'm going to process some Minecraft renders at maximum resolution" album
 
Which I'm actually about to do :p
 
@JonClements Doing good! Recently started with Python/ML/Math
You?
 
1:42 PM
but i don't want to stop and also it only helps temporarily
 
I want to say "turn up the thermostat" but I'm getting some real "let them eat cake" vibes from that, and I don't want to be first against the wall when the revolution comes
 
Now we're on that topic.. What about back pain?
 
haha we dont' have one at university. it's just cold in winter and hot in summer. we complained multiple times but nobody cares
nah back pain is fine, just gotta keep a good posture
 
How ?
Like I start in a good position
and then 20 minutes later I am sitting like Smeagol observing the ring.
 
^^
 
1:46 PM
I start each day upright but tend to scooch down to a ninety degree angle by noon.
 
cabbage
 
Exactly.
 
@Катерина alright thanks :)
 
There's some very strange people in here...I start at a 180 degree angle, and try to make 90 degrees by 8 or 9am, 60 degrees on a bad day.
 
I only experience back pain when I stretch just after waking up. And only if I stretch assymetrically, i.e. reach upwards with only one arm. Both arms is fine.
 
1:49 PM
Will I be blocked from asking questions on SO if I do 30 upvotes at a time?
 
@Kevin Kevin is a bat, vampire, or robot?
 
@Катерина relatable x3
 
I don't think mods hand out question bans for users that have odd patterns of upvotes. They might reverse those votes, but that seems like a separate issue
 
I've been living with back pain for years now. Maybe I should consider a docter lulz
 
@bhatnaushad that's bad, but not the reason you got question-banned
 
1:51 PM
@bhatnaushad After you're tracked down and given 30 lashes, I don't know if that would be your greatest concern...
@Катерина Dr Lulz...won't cure your back, but will make you laugh until you cry from the pain of your condition?
 
I hope not :3
 
@Катерина swimming does wonder. It helped me a lot. The good thing is the effect even stays once you stop swimming
 
I have been banned from asking questions, what can I do about it?
 
Ask a question on Meta (which you did), then read the duplicate
 
51
Q: What can I do when getting “We are no longer accepting questions/answers from this account”?

Robert HarveyDo not repost the question you were about to ask until you have READ EVERYTHING WE ARE ABOUT TO TELL YOU. While trying to ask a question, one could get: We are no longer accepting questions from this account. See the Help Center to learn more. Likewise, for answers: We are no longer a...

 
1:59 PM
@vaultah How do u know that I asked there?
 
Meta is public
 
or the main page :P
 
@vaultah just curious, what are you planning to do with that expired bounty?
 
How do you have 30 Rep? I don't get it 2 upvotes and 2 downvotes and all other questions are 0. Shouldn't this give 6 Rep instead of 29 ? @bhatnaushad
 
2:06 PM
@coldspeed pack it up, it'll do good service when he retires
 
Is repo only updated periodically on so?
 
@Hakaishin edits? Deleted older posts? Accepts?
 
@coldspeed award it to the worst answer, I guess
 
Ah so you still keep the repo for deleted posts?
 
Sure, I've got more rep from that answer than I've deserved
 
2:09 PM
I'll wait for it to be awarded automatically
 
@Hakaishin FYI there's no repo in reputation
 
Ah I don't think that's going to work. No new answers were posted since the bounty was instated. If the bounty is not manually warded, it will automatically go to the answer with the most votes that was posted after the bounty was initiated
 
And rep awarded for posts with at least +3 (if I recall corectly) stick after 60 days. Not a huge risk here though
 
repo fits the mold for australian slang
 
In my neck of the woods, "repo" is idiomatically understood to mean "repossess"
 
2:11 PM
None of the answers qualify, so it will likely go to waste once it expires
 
ah right^^
 
> If there's no answer meeting those criteria, no bounty is awarded to anyone.
Oh, sweet. Even better
 
@Kevin or repository
 
There's a certain charm to the idea that all reputation rewarded is actually reputation being reclaimed from the askers to the answerers. Like it's our birth right.
 
Not on the list but ...nomadsworld.com/aussie-slang
 
2:12 PM
I still don't understand why you even put a bounty on it in the first place
 
"I was born great, now I just need everyone to recognize that fact"
 
@Kanak: 15 minutes of entertainment during boring holidays. Well, 40 minutes combined, if you consider two other bounties. The comedic effect is in "This question has not received enough attention". — vaultah yesterday
 
I would have to struggle to find any entertainment whatsoever. Unless it's answering questions from confused users
I can see how some would enjoy that :P
 
Some men just want to watch the world burn
 
burn using...banknotes as kindling?
 
2:25 PM
How well does modern money burn, anyway? I recall reading that the Germans burnt money for warmth during the hyperinflationary period following WWI, but I suspect modern materials science has made that kind of tactic less practical.
 
^ bitcoin is terrible for burning
 
bitcoin already warms you when you're creating it
 
You could write down your wallet password (key? Identifier? Whatever) on a napkin and burn that, but it lacks oomph
en.wikipedia.org/wiki/Money_burning has some examples of money being burned in modern times, so I guess I've overestimated the amount of effort that governments have put into designing fireproof bills
 
it has been 30 days since I've answered a question
 
They achieved "doesn't run or melt in the washing machine" and decided that was good enough
 
2:31 PM
This is a milestone
 
I remember that video of a guy trying to burn a EU flag but it didn't work well because the flag followed the EU norms and thus wasn't easily burnable
 
We have polymer notes in the UK so burning money is likely to release fumes that can only serve to drive you to burn yet more money
 
UK is good at burning money these days. *mic drop*
 
2:46 PM
^ sic burn
 
<applies aloe to last remaining national pride>
But, hey, the notes are lighter than our old ones, and pack tighter, so you get more bang for your wheelbarrow
 
while we're at money, dollars look like monopoly money and so easy to fake, compared to swiss francs
 
Swiss francs aren't a fair comparison. That country makes a living out of money.
 
^^
but also kinda compared to the eu
 
\o cbg
 
2:55 PM
Grrr, now I'm reminded of my distress at not having shorted on the pound for the last 2 years :( definitely putting a wager on the Commons vote
Cbg Mooing
 
Back to australia... I heard you can bake an ausie dollar and it will shrink like a shrinky-dink
 
@piRSquared oooh never seen those in action, neat!
 
Hey guys I have a question
curl --proxy 127.0.0.1:24321 "http://lumtest.com/myip.json"
I got this from a premium proxy site
I don't know how to use this
 
It's like one of those fortune fish that flop around on your hand. "Mum and dad are not going to be impressed with you"
 
I just need the IP and port
But it seems there are curl --proxy and the "http://lumtest.com/myip.json"
 
3:02 PM
that looks like a command you enter into your terminal that GETs something on a given port or something
Do you want to make that request via a python script?
 
#!/usr/bin/env python
print('If you get error "ImportError: No module named \'six\'"'+\
    'install six:\n$ sudo pip install six');
import sys
if sys.version_info[0]==2:
    import six
    from six.moves.urllib import request
    opener = request.build_opener(
        request.ProxyHandler(
            {'http': 'http://127.0.0.1:24321'}))
    print(opener.open('http://lumtest.com/myip.json').read())
if sys.version_info[0]==3:
    import urllib.request
    opener = urllib.request.build_opener(
        urllib.request.ProxyHandler(
This is the python equivalent rather the other was in shell
Yeah I have a python script I will rotate the IPs
The website i'm scraping is quite annoying
 
@piRSquared that looks so funny and cool
 
@Pherdindy It doesn't let you scrape?
 
^^
 
My requests time out
 
3:04 PM
how uncouth
 
I remember you from last month :-) the site must have pretty substantial defenses if you're still trying to defeat them
 
And has this error: "requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.lazada.com.ph', port=443): Max retries exceeded with url: /catalog/?_keyori=ss&ajax=true&from=input&page=2&q=jewelry&sp"
 
sounds like they still don't want you to scrape
 
Dec 11 '18 at 19:40, by Andras Deak
I'm merely talking about the possible ethical questions raised by scraping a site that doesn't want you to scrape it
 
3:06 PM
Maybe I just don't know how i'm a noob when it comes to python :(
 
I still have my concerns
 
Well I'd waste too much time with a pen and paper
Writing down all the data
Huhu anyway I won't spam their servers
I make a long delay on the scrapping
 
The last time I looked at urllib's documentation, it was pretty light on detail re: proxies, so maybe it's just a complicated concept
 
Maybe i'll just look around
Thanks
 
The idea of not being allowed to scrape stuff is kinda of a weird grey zone. Like sure you can look at our stuff, just not too fast :P
 
3:09 PM
I was able to scrape like 1 page
Then after that it just times out
 
@Hakaishin the difference is fair use
 
I barely have the patience to write scrapers that target websites that don't care about scraping. I'd tear my hair out if they were actively trying to stop me.
 
when you browse their page as a customer, you'll look at it slowli. If you make 50 requests in 10 seconds you're unlikely to buy anything, more likely to try to make a living off of their content
 
I'd rather just click the "view all results on one page" button*, copy the page contents into notepad, and do complicated regex on it
 
3:11 PM
Yeah I put a delay with time.sleep(120)
 
(*not all websites have this. Pagination is a plague upon my house.)
 
I guess if content is their actualy product I agree it is unfair. But if they sell something else than what would be the problem?
Now I wonder what you want to do anyway? @Pherdindy
 
I am a seller in that site
I am trying to plot the prices
And see the ranges
So I can see if it's feasible
 
I guess this does sound like fair use @AndrasDeak
 
And trying to find out which items sell good
 
3:17 PM
Dec 31 '18 at 9:46, by Pherdindy
And I found a way to maximize reviews
 
Ofc if you don't do it too fast to crash their servers
 
By analyzing reviews numerically
 
I wonder what this was about then
 
Oh that was another thing
 
lol, that souns shady af
 
3:18 PM
A fair thing, surely?
 
My rule of thumb is "if the website says it's not OK to scrape them, then we don't get to decide otherwise on moral grounds"
 
That was just me buying my own stuff
Since they had 0 commission and 0 fees
 
Very fair
 
haha it gets better and better^^
 
But then it's too time consuming so
I didn't do it
So ethically
I'm clean
 
3:19 PM
You can have that opinion
 
Anyhow I think they just don't like scraping
Cause of the resource usage
So putting a time delay should make it okay
 
I'm also doing some scraping - lxml xpath syntax is in theory very powerful but in reality not very well explained by example anywhere. I've been googling for a month... trial-and-error work faster
 
But in any case, I lend my technical knowledge to people regardless of whether their intentions are pure. If I knew how to use proxies, I would have said so twenty minutes ago.
 
Yeahh I guess I have to look around a bit
 
@Kevin Do you do an internal assessment of the intentions or you would expalin something even if you knew the person wants to do something you consider bad?
 
3:30 PM
Most of the time you can't tell from a question whether the OP's code will be used for good or evil, and I don't pry any further. It seems like a weird double standard to me that people ask "did you get permission to scrape this site?" but not "did you get permission to remove duplicates from this list of strings?"
 
Rest assured i'm a nice guy :)
:D the smileys says it all
 
In practice I don't often reply to questions that have potential ill intentions, mostly because they tend to be low quality questions irrespective of their moral value
Script kiddies that want to hack their Fortnite opponents rarely supply good MCVEs
 
@Kevin did you get permission to take clippings of my prize roses vs. did you get permission to pour salt all over your own garden?
 
When Volkswagen programmed its onboard computers to behave differently during emissions testing vs ordinary driving, I wonder how many times they asked utterly banal questions about list indexing on Stack Overflow, which everyone was happy to answer
 
The point, at least for me, is that the resource does have to first be paid for by the originator, physically built by them, actively maintained and curated by them and they may have any number of restrictions. I'm not some moral purist over this stuff, but the difference seems pretty clear to me
Well if the question stated "I'm going to commit fraud..." at the start, the intent is clear
You cannot be expected to make a judgement on something that has no obvious indication of intent. But if the intent is clear, do you not feel some obligation to make a judgement?
 
3:45 PM
Yes, but I think we have different standards of what constitutes clear intent
 
I'm sorry guys i'm a bad guy this chat might cause world war 3 cause I wanted to web scrape
Butterfly effect bros
 
Probably why we're both going to the extremes in the examples :P
Nah, I'm just playing devil's advocate really to what was an extreme counterexample to my stance. What you're doing is pretty banal in this debate and I don't feel strongly either way
 
I found out how the thing works
You connect using an static IP
Then they use that to connect to other IPs or something
So it keeps changing
So I get this dictionary: b'{"ip":"92.240.206.159","country":"PA","asn":{"asnum":9009,"org_name":"M247 Ltd"},"geo":{"city":"","region":"","postal_code":"","latitude":9,"longitude":-80‌​,"tz":"America/Panama"}}'
But when I do print(len(proxy_details))
I get 173 I don't understand why
 
If you connect using a static IP they will just blacklist that IP
 
Yeah I mean the proxy website gave me a static IP to connect to, but to connect to the website I wanna scrape
They give me rotated IPs
#!/usr/bin/env python
print('If you get error "ImportError: No module named \'six\'"'+\
'install six:\n$ sudo pip install six');
import sys
if sys.version_info[0]==2:
import six
from six.moves.urllib import request
opener = request.build_opener(
request.ProxyHandler(
{'http': 'http://127.0.0.1:24314'}))
print(opener.open('http://lumtest.com/myip.json').read())
if sys.version_info[0]==3:
import urllib.request
opener = urllib.request.build_opener(
urllib.request.ProxyHandler(
{'http': 'http://127.0.0.1:24314'}))
 
3:49 PM
"So I get this dictionary:". Not quite. The b at the front their indicates that the type of that object is bytes, not dict.
 
proxy_details changes everytime
 
I wonder if json.dumps would help you get the object you need
 
@Kevin oh thanks. Sorry i'm so bad at python i'm still learning this stuff
I am interested in getting the ip and port
How do I do that?
 
Or, oops, I mean loads
Constructing an example as soon as I remember how to turn a bytes into a string
 
loads accepts bytes
 
3:54 PM
Excellent.
>>> import json
>>> x = b'{"ip":"92.240.206.159","country":"PA","asn":{"asnum":9009,"org_name":"M247 Ltd"},"geo":{"city":"","region":"","postal_code":"","latitude":9,"longitude":-80,"tz":"America/Panama"}}'
>>> d = json.loads(x)
>>> print(d["ip"])
92.240.206.159
 
I found this also: proxy_details.decode("utf-8")
Returns this: '{"ip":"178.171.59.131","country":"RU","asn":{"asnum":8496,"org_name":"Optibit LLC"},"geo":{"city":"","region":"","postal_code":"","latitude":55.7386,"longitud‌​e":37.6068,"tz":""}}'
 
CK.
That just converts it to a str. It's still not a dict
 
Yep, that'll give you a string object. Which you can then pass to json.loads and get a dict back.
 
Ahh right that makes sense
Cool thanks I would really love to learn more python and progrmming in general
But I just don't got the time
 
@Pherdindy Might be worth going through this
 
3:58 PM
@coldspeed thanks will look into that
@Kevin thanks a bunch now I can continue my quest for world domination :P
 
4:20 PM
Hmm, how long has Python 3 had a specific error message for print without parentheses? I'm trying to guess which version that this guy has installed. He's getting a generic syntax error, so it's probably fairly old.
 
3.4
 
Ah, you're right.
What's New in Python 3.4.2rc1?
==============================

Release date: 2014-09-22

[...]

- Issue #21669: With the aid of heuristics in SyntaxError.__init__, the
  parser now attempts to generate more meaningful (or at least more search
  engine friendly) error messages when "exec" and "print" are used as
  statements.
raw.githubusercontent.com/python/cpython/master/Misc/HISTORY continues to be a useful resource, albeit five seconds slower than just asking in chat
Hmm. But why does the history stop abruptly at 3.4.6? Is this a conscious decision?
 
The moved to a different NEWS format
 
[Angery.png]
I need a single file that I can ctrl-f through >:-(
 
cbg. Anyone know how to play an mp3 in Python in a daemon way (i.e. not wait until the mp3 is played?) (I tried playsound, but it waits for the sound to complete playing)
should I just create a Thread?
 
4:27 PM
Not that it's a huge issue. Usually when I'm interested in the history of some feature, it's from way back. If I want to know about stuff introduced in 2018, I can just use my memory.
@isquared-KeepitReal Maybe the module natively supports asynchronous playing. Try playsound(myfilename, False)
 
@Kevin it doesn't
 
Are we talking about pypi.org/project/playsound? Because it says it has a block argument... Maybe it's keyword only? playsound(myfilename, block=False)
 
What OS do you use?
if not block:
    raise NotImplementedError(
        "block=False cannot be used on this platform yet")
 
If that doesn't work either, consider filing a bug report.
 
yes, that one. MacOS
think it is unimplemented
yeah
 
4:31 PM
That's the error message for *nix
 
oh
block=False and just False doesn't play it
 
_playsoundOSX looks like it should be able to play asynchronously. [urge to file bug report rises]
 
it doesn't look like that library is maintained. There are open PRs from 2017
 
In the meantime, you may as well try your threading approach. I'm cautiously optimistic that it will work.
 
Maybe it detects the OS wrong
 
4:34 PM
let's try
if it didn't detect correctly, wouldn't I get that NotImplemented error?
 
github.com/TaylorSMarks/playsound/blob/master/playsound.py#L122 suggests that it assumes your OS is Linux if it can't figure it out from the system string
In which case it would raise the *nix-specific NotImplementedError, yeah
 
my threaded approach works
```
#!/usr/bin/env python3
from playsound import playsound
from threading import Thread

base_path = '/Users/someoneanonymous/Downloads/futuresoundfx-98/ futuresoundfx-%s.mp3'

#playsound(base_path % 21)
thread = Thread(target=playsound, args=(base_path % 21,))
thread.start()
print(2)
```
 
Wow, it is 3.x! Thanks! Somehow Anaconda environment changed python version — Dims 12 mins ago
Aw, but I wanted to know what version of 3 it was specifically. Mystery not solved ;_;
That's kind of a weird exchange, isn't it?
OP: I think my code switched to Python 3 for some reason. Why?
Me: first, let's determine what version you're using. Go look that up and we'll work from there.
OP: Oh, it's Python 3! That answers my question, thanks.
But does it? Does it really?
 
I think I am missing something
I got the peer's IP and port, but I cannot use it
headers = {'USER_AGENT': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0'}
link = 'https://www.lazada.com.ph/catalog/?_keyori=ss&ajax=true&from=input&page='+str(i)+'&q='+str(search_keyword)+'&spm=a2o4l.home.search.go.239e6ef06RRqVD'
proxy = proxy_dictionary["ip"] + ':' + str(proxy_dictionary["asn"]["asnum"])

req = requests.get(link,headers=headers,proxies={"https":proxy})
I get an error at requests possible due to no permission to use the IP
Is there an argument i'm missing using requests?
 
4:50 PM
What, specifically, is the error message?
 
It's quite long
Traceback (most recent call last):
File "C:/Users/Asus/Desktop/Test/Testing.py", line 41, in <module>
req = requests.get(link,headers=headers,proxies={"https":proxy})
File "C:\Users\Asus\Desktop\Test\venv\lib\site-packages\requests\api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\Asus\Desktop\Test\venv\lib\site-packages\requests\api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\Asus\Desktop\Test\venv\lib\site-packages\requests\sessions.py", line 533, in request
 
Cannot connect to proxy looks relevant
 
Yeah it does
I think I need permission
 
in order to more easily answer questions like "is this code failing because I can't connect to the proxy, or because the website is cleverly rejecting requests from known proxies?", you might try using your proxy to connect to a website which does not reject requests from proxies. The best candidate would be a website that you yourself control. But I bet example.com is a pretty good alternative.
 
When the URL is in http
Requests will succeed
It fails in https
It might be a configuration in the proxy I read something about a SOCKS5 server
Let me try
 
5:17 PM
How do I chain transforms in ros?
 
 
1 hour later…
6:34 PM
Any objections to me merging all answers from stackoverflow.com/questions/12179271/… into the linked duplicate post?
 
Apparently having "beginner" in the title garners hundreds of thousands of views, despite being asked 4 years after the original. Who knew!
 
I'm still not sure when I should use a staticmethod vs a classmethod vs a regular function vs a SimpleNamespace. Probably because I get distracted 100 words into any explanation
 
Code golf: write a regex pattern that matches a string iff the string contains every letter A-Z exactly once, in any order. The record to beat is 10485577989291746525184000000 characters.
 
@vaultah: why did you add a bounty to stackoverflow.com/questions/1323410/…, may I ask?
 
6:47 PM
Hmm, maybe something with negative lookaheads...
 
We really didn't need another 3 answers stating the obvious.
 
recbg
 
@Kevin we can lead a horse to water, but if the horse gets lost reading the directions...
 
Yeah. It's nobody's job but my own to overcome my willfull ignorance :>
 
aww, I missed "manipulating online reviews is fair" chat
 
6:55 PM
@MartijnPieters see my comment
 
@vaultah yeah, no, that wasn't enough of an explanation.
And frankly, your entertainment is now my headache.
8
 
Got it down from 10485577989291746525184000000 down to 1368 characters: pastebin.com/mAVeyHDB
Open question: is it possible to write a regex that matches "any string that contains no duplicate characters"? It's easy (albeit long-winded) when the number of possible characters are small, but the entire unicode range is decidedly not small.
 
@MartijnPieters sorry
 
The converse is much simpler find all strings that do not match r'(.)(?=\1)'
[string for string in test_cases if not re.search( r'(.)(?=\1)', string)] or whatever
 
Might need alterations to detect strings with nonconsecutive repeats, ex. "aba", but we're in the right ballpacrk
 
7:11 PM
Aaaah, r'(.).*(?=\1)'
 
[title card: the gang discovers catastrophic backtracking]
stackoverflow.com/questions/54152179/… inspired this challenge, and it has some answers now, although I am skeptical of them
 
7:32 PM
75% convinced that a_guest's solution works, although I must be misunderstanding the mechanics because I expected it to have O(N^2) runtime but the timings reported by the online regex tester looks more like O(N)
 
If someone could point me to a post, or write one about understanding the complexity of regular expressions just by looking at them, I would be so grateful
As in, grateful enough to give you a bounty (if you can write it, that is)
 
that would be quite a post
regex complexity alters greatly depending on the implementation as well
i can see if i find some articles, I don't think I'd be able to write a good post
 
In this specific case, a_guest's pattern is roughly equivalent to:
names = "JOHN,MARK,EDDIE".split(',')
for idx, name in enumerate(names):
    #confirm that this name doesn't appear later in the pattern
    dupe = False
    for future_name in names[idx+1:]:
        if future_name == name:
            dupe = True
            break
    if dupe:
        break
if dupe:
    print("Pattern failed to match - duplicate found")
else:
    print("no duplicate found -- pattern matches!")
 
I would be fine with a writeup in the context of CPython, but if you find/come up with anything else, more than welcome
I have seldom seen it come up in any discussion involving regexes
 
do you know this one already? it's one of the more popular ones, and quite fun to read because it's so opinionated
 
7:43 PM
yes I just found it. Was about to ask whether it was worth investing time into, to understand all the greek and latin there :D Guess I'll take a look
 
@Kevin Does look like all(k and v == 1 for k, v in Counter(names.split(',')).items()) would probably work...
 
Yeah, I would definitely skip regex entirely for this if I was writing production-quality code
 
Although - that won't handle "JOHN MARK" as a failure case... I wonder if "JOHN MARK,BOB" is a pass/fail case though...
 
This man clearly doesn't have any American clients, because he'd know that user Billy Jo Bob makes his matching logic fail in multiple ways
 
00:00 - 20:0020:00 - 23:00

« first day (3009 days earlier)      last day (1958 days later) »