« first day (3301 days earlier)      last day (1872 days later) » 

17:00
@AndrasDeak ok, but other than that is that generally the correct way to do it instead of using eval()?
And I'd just try the conversion and only continue after except
@erotavlas anything that doesn't use eval is superior
you mean like this

threshold = 1
try:
  threshold = float(inp)
except ValueError as error:
  print("Error 1: Input cannot be cast as float", sys.exc_info()[0], error, inp)

if 1 > threshold:
  print("greater")
else:
  print("not greater")
wim
wim
@Aran-Fey yes
So yeah, generally try-except
@erotavlas yup
wim
wim
sometimes you can resolve circular imports just by changing the "from" imports to normal imports
17:02
@erotavlas no, wait
wim
wim
why are you digging out of sys.exc_info
@erotavlas Yes. Using eval on arbitrary input strings is almost always a bad idea. Though I wouldn't do it exactly like your code. I'd prefer to give the user another chance to enter correct input, rather than raising an exception.
Don't you want to raise in except? Or ifit's a function, return atleast
this is automated, there is no user
there is no second chance
wim
wim
why except the error at all then?
just let the ValueError blow up the stack
if there is no user, who are you printing for?
17:05
cbg all!
.....<thinking>….
Is there any way to override the __dir__ for a module? I know that for a class you can do something like this: stackoverflow.com/questions/15507848/…
ok there is a user but its not a person, its a C# process
I'm printing the message for the process to capture via standard input/output
what is the desired outcome of a bad input?
17:08
a permanent vacation for myself :)
ugh, mrjobs is such a stupid library
its too damn hard to figure out exactly what i've sent to the next step and debug that
no wait $1,000,000 dollars deposited in my bank account
haha. what should be a realistic outcome of a bad input?
for this script? nothing it just exits....its up to the c# process to act on the exception if one is returned to it
wim
wim
@shuttle87 just def __dir__ at the module scope (note: this requires Python 3.7+)
17:10
like try again, orrestart web service etc
does your mapper send every key pair value before a combiner starts executing? does it send an iterable? i have this input file that is just a number on each line and when i try to iterate in later steps it seems i sent it an int instead of the iterable
@wim ah awesome! didn't realize this was in 3.7
@wim LGTM
@erotavlas then you shouldn't supress the error. let your code exit with an error status. (also, why isn't this code in C# as well?). C# will have a much better time catching a non zero exit code, rather than a code that "pretends" to have run perfectly fine, except for a very specific string it printed out saying everything wasnt fine. But yes, im going on the assumption this isn't the entirety of what the python code is supposed to do, is it?
Funnily enough, this makes me realise, i don't actually know if a python program that raises an exception gives a non zero exit code on its own or not.
17:20
@ParitoshSingh the script will be compiled intoe a console .exe using pyinstaller so it will behave like a console application when launched by the c# process. if it just crashes the process will simply exit, in which case I would have to check if its exited or not each time I try read/write from standard input output
which is fine I should be doing that anyway, but I'm passing it inputs while it is running so I do need to check the ouput for any error conditions so I can act accordingly
hence the reason for printing the exception , I'l be checking the standard output for something like if string starts with Error or something like that
Hm, im not sure i follow a 100%, but i can leave that be. Why is this bundle not in one language, either C# or python? just curious.
because the machine learning community decided python was the best for them and now all the best machine learning stuff is in python so we have to do python c# interop so our .NET applications can utilize our machine learning models
whelp. i approve of the machine learning community's decision. :P
So i can't say much there. haha
this is more of a problem with something like a desktop application, but for a micro webservice I'm thinking of rewriting it using Django or Flask
right now I'm 'sneaking' python into our webservices (asp.net) using pyinstaller
morning cabbage
wim
wim
17:36
oh yeah, pyinstaller. that's a thing that exists.
i dont understand something about python mapreduce guys, is it streaming data line by line between the methods or does it aggregate them and yield? I haven't been able to properly iterate over things that come out of my mapper and combiner. Whenever I write a loop on the values coming into my reducer like [x for x in values] it says cant iterate over an int
What's "python mapreduce"?
sounds data science-y
well yeah, mapreduce is google's magic sauce or something, but the implementation has to be library-dependent
hey, not everything is data science's fault :P Though this one probably is, haha. (it's probably hadoop mapreduce, but the main point is, Skyler needs to clarify things and give proper context, or there's no point trying to guess what exactly they're asking. Also, mcve can't hurt)
user11867329
17:51
@Kevin can you send link if you have a minute? (the thing)
no google fu involved here. hadoop clusters though, very likely.
lol
is map reduce made by google?
I guess so
I had heard about it as an apache application
Skyler, we don't actually know what you're referring to so far when you say "python mapreduce".
or design framework
map reduce in python (a few posts earlier i mentioned mrjobs in particular as the lib im using)
user11867329
@Kevin nvm, found it.
17:54
i just forgot the space that last time
my bad
@Skyler Ah, so "python mapreduce" means map reduce in python. I see :P
@erotavlas no
its just infuriatingly finicky to understand
So, i only know very little on this subject. But if you'd like to hear a recommendation, blind leading the blind so to speak, i'd recommend removing middle-man libraries for now.
cbg
17:58
pick the simplest "hadoop mapreduce in python" tutorial. Imo there's some really good ones out there that let you see whats going on step by step
say, this tutorial This looks like one of the ones i might have seen when i was exploring this.
dupe This question on failed scipy installation seems to involve multiple Python installations. What's our dupe target that compares Anaconda, virtualenv, pipenv etc?
@smci I don't think that would be a good dupe target, whatever it is
> ModuleNotFoundError: No module named '_ctypes'
sounds like a partial python install
(yesterday I spent around four hours getting rid of exactly that...)
@AndrasDeak Uhuh. The OP's setup seems quite messy, and they don't have a distro or virtual en. Feel free to suggest them better. Either way, it's a dupe of something on SO, so let's point them in the right direction for searching.
not sure what it is, it can be multiple things
I guess "unclear" could cover it then...
@AndrasDeak No I don't want it closed unless a dupe is found. And personally I'm too busy right now to go back-and-fro with the OP to figure out their symptoms and which dupe.
18:04
OK
I hate the new dupe auto-comment
@AndrasDeak Perhaps, but that target's title is not general enough and would need editing. The title says nothing about failed install/update or ctypes, and really this issue is general, not about a specific package like multiprocessing.
I googled the error and got that post, so it's good enough for me.
(But, you guys routinely harangue me when I edit titles, even messy misleading ones. So, you or someone else can do this edit.)
@AndrasDeak Eh? Please no, that question is a jumbled mess. It all boils down to "If you run a while/forever loop iterating over a list, of course it will run off the end of the list and cause IndexError: list assignment index out of range". Anyway, that particular question seems like it could be replaced with a list-comprehension, which is cleaner and safer, and avoids the IndexError by construction.
I disagree
wim
wim
18:10
@AndrasDeak shed a tear for the n00bs trying to do mapreduce with map and reduce
user11867329
What's the proper fix for :

> SyntaxError: Non-ASCII character '\xe2' in file lolplswork.py on line 53, but no encoding declared
declare the right encoding
user11867329
Which would be?
only you can know that
wim
wim
the encoding that it's encoded in?
user11867329
18:13
UTF
for you to know, and us to probably not have to guess
user11867329
same as the rest
user11867329
its a txt file
You don't have to tell us. Tell it to python.
user11867329
> How do I tell python to use UTF encoding?
18:14
that's something good to google if you add what you're doing with python
wim
wim
# -*- coding: same as the rest (its a txt file) -*-
it might even help to read the docs of the building blocks you're using
@wim :|
user11867329
@wim now my machine is flashing red and cop cars just showed in front
wim
wim
ahh good, don't drop the soap
user11867329
aw come on, think of the guy from behind
user11867329
18:16
he's the real victim
okay, that's enough
user11867329
He started it.
user11867329
Run my fully working script for me and I'm gone for the day
user11867329
cause you'll fix it running it if these types issue
user11867329
see how I think?
user11867329
18:17
genius.
yesterday, by Andras Deak
@OakDev you said yourself that you are "at this point leeching". So please stop doing that. You can only ask for free help as long as people are willing to give you that. If they stop, you have to stop too.
user11867329
Are you a mod? Who made this guy mod?
I'm not a mod
user11867329
oof
@AndrasDeak Broken titles matter, and need to be fixed. You're taking it for granted that new users in general know the SO search feature to be broken and know to use Google/!ddso instead, which is incorrect.
18:22
okay
user11867329
# coding: utf-8
user11867329
Do I include hashtag? Or am I an idiot.
@OakDev try and see? Google about coding headers? Come on.
before I lose my mind trying to reproduce this problem in a new project, does anyone have an idea why sphinx's .. automodule: my_package.exceptions would not produce any output? It works if I manually list all the classes with :members: Error, SerializationError, ..., but doesn't work automatically. I tried :members:, :undoc-members: and :ignore-module-all: but still no output
user11867329
@AndrasDeak You sure like teaching a lot.
18:23
@OakDev exactly. I hate feeding people. I love teaching people how to feed themselves.
It teaches people a valuable skill and reduces noise in the room. Two birds, one stone
@Aran-Fey admittedly not very helpful but I've always manually provided a list of all functions to document "automatically"
user11867329
@AndrasDeak Aw, thanks, I had not thought of Googling.
snip from one file
Date Function Summary
--------------------

.. currentmodule:: cvutil.date

.. autosummary::
   :toctree: generated
   :nosignatures:

   now
   today
   month_begin
   business_month_begin
   month_end
   business_month_end
   prior_month_end
   lag_days
   lag_business_days
   prior_day
   prior_business_day
   date_to_y4mmdd
   y4mmdd_to_date
@OakDev always a pleasure to help
18:27
But to answer your specific question, I'd have to fumble around much as you are )-: sorry
I originally suspected that the problem was the missing __all__ definition in my module, but adding it doesn't help either. And all other modules seem to work as expected. It's really weird
user11867329
@AndrasDeak Yeah, I assume! Being a reputable member of the biggest Q&A in the world.
user11867329
and alll
user11867329
Aw wtf I needed the #
Eerie, the new "dupe link" comment had me weirded out
18:29
@ParitoshSingh I hate it
My first thought was that an imposter wrote a comment on my behalf. silly, i know.
@ParitoshSingh frankly that's not silly at all
It reads like an open invitation for a response from the OP, a channel for 2 way communication. Except, i never wanted to initiate one.
But i suppose i can get used to it, if it helps.
@piRSquared Hmm, autosummary doesn't seem to be a part of autodoc. It's a separate extension?
Well, not that it really matters
user11867329
> from itertools import zip_longest
ImportError: cannot import name zip_longest
18:31
@OakDev python version?
@Aran-Fey oh, shoot, you see that. I didn't even remember that
user11867329
latest
user11867329
3.7
can't repro
user11867329
3.7.3**
18:32
try import sys; print(sys.version_info)
works fine for me too. do you have another file named itertools.py in the same working directory?
also import itertools; print(itertools.__file__)
right, that too
what would you guys wear to an interview?
user11867329
That's odd, I'm still on 2.7 (izip_longest) but I just upgraded py
18:33
@OakDev gasp
@erotavlas depends on the organization
user11867329
>:O
And the role too honestly
try python3...
user11867329
18:33
yeah no sh**
but wear your best. it's very easy to be underdressed for an interview.
I was reading not to wear a suit, I wouldn't wear one anyway
@OakDev I meant the actual executable
user11867329
Wow yeah I just read/understood that
user11867329
cause when I python3.7 --version
user11867329
18:34
works
using python3.7 is fine too
user11867329
do I python3 or python3.7
You don't have to wear a suit (unless it's a role that involves suits) but formals is usually expected from candidates.
user11867329
thx
@OakDev speaking for myself only: Please keep your tone and language civil. I have this chat open at work and it doe not serve me if folks walk by my desk and see your language
18:35
so no business casual?
user11867329
@piRSquared I understand, >asterisks
i don't have a sports jacket :( I mean i have a dressy black one but its black, it might be ok
@erotavlas at this point, i myself need to google what is business casual vs what is formals haha. whoops! But i suppose, do you have a "sense" of what kind of clothing the company and role expects? what is the role in any case
i was also reading blue is better and makes people trust you more
probably what my current company is wearing, casual, I mean I wear jeans every day
Okay, having googled it, i misspoke. i don't think you need suits and ties. Business casual should* work.
user11867329
18:37
> paragraphs = [paragraph.strip() for paragraph in file.read().split("\n\n")]
File "/usr/local/lib/python3.7/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
I was imagining it in any case
user11867329
invalid start byte?
wearing casual clothes to work with runner type shoes everyday really takes a toll on the wardrobe though, there's no inclination to buy better clothing
@OakDev it would seem so
i think I've been wearing the same pair of shoes for a year now
18:38
did you open that file in binary mode by any chance?
surely no decoding would take place if it was opened in binary mode?
hm. I wear the same pair of shoes to work as well, and i didn't think until now that there's anything weird about it. Do people change shoes often?
@Aran-Fey hmm, you're probably right
i don't know, i don't really look at peoples shoes very often
except when I'm sitting at a boring meeting
user11867329
@AndrasDeak Let me rememeber. I-I... actually I downloaded the .txt from pastebin with wget
18:40
@OakDev okay, I'm out
user11867329
>_>
@OakDev All we can tell you is that you opened the file with the wrong encoding. You don't show us how you're opening the file, so we can't tell if you did anything wrong there. If you need to find out what encoding the file uses, google is your friend
@ParitoshSingh I alternate between 2 pair of casual shoes and a pair of sneakers... unless it's flip/flop friday, then I wear flip-flops. I keep a pair of dress shoes under my desk in case of an emergency
oh wow, flip flop friday sounds epic haha
@Aran-Fey they think it's UTF. Though it could still be non-8 I guess
18:44
i wouldn't want to see my co workers toes
user11867329
@Aran-Fey @AndrasDeak transfer.sh/15sUO5/ORGA
@OakDev a "text" file doesn't typically know its own encoding
user11867329
downloaded with wget and then did mv to rename, that's all I did
user11867329
Is there something I need to do
@OakDev you presumably opened it in python but that's probably without any encoding
user11867329
18:45
that I'm not aware of
yes, find out the correct encoding
ask the person who created the file
user11867329
I did
user11867329
Notepad
user11867329
Well, monkey did
user11867329
18:46
Notepad on WIN.

Emailed to me, opened with Notepad++ (So should be UTF8)
user11867329
Happens only on line 322 (results starts printing at 50ish)
user11867329
Saved and uploaded to transfer.sh
user11867329
nothing more, nothing less.
so, have you done anything to find the correct encoding other than open it in notepad++?
user11867329
I googled win notepad's default encoding
user11867329
18:49
which is also UTF8
user11867329
and I checked on notepad++, it's also UTF8
user11867329
Experts, gather, I believe it's encoded with UTF-8
We believe that's what you believe. But python says otherwise.
okay, so there are 2 options: 1) python's utf-8 decoder is b0rked 2) it's not actually utf-8
In other news, my python build broke overnight...
ModuleNotFoundError: No module named 'readline'
I swear this worked last night, ugh
18:51
Ruh roh
unless I got confused after all that sweat and blood, which is plausible (so let me just rebuild it again)
Aaand it's working now. And I bet that if I log out and log back in again, it will break
wim
wim
@ParitoshSingh can you just delete the comment? haven't tried the new, err, features yet
@wim I could
next time I'll just edit it into the old one, I bet I can do that too
Oh, and yesterday the comment was also there for gold badgers, but I heard that was just a bug
18:57
It's just like a normal comment for all intents and purposes
Best I can tell anyways.
that's how the old one worked too
wim
wim
automatically posting comment from me? yeah, nah, no thanks.
post-comment hooks just as evil as post-commit hooks
user11867329
@AndrasDeak Ok, if you ever feel like taking a look, I gisted both file & script.
I'm trying very hard, honestly.
Yeah, I can decode that with utf-8 just fine
19:02
I was about to say just that
Copy paste your own gist back into your system. Overwrite old files
wim
wim
the first line of super.__doc__ is really confusing. <first argument> of what? like, you're not gonna know what that means unless you already know how super works, which is a pretty big ask given all the magic.
user11867329
@ParitoshSingh Doesn't work, same error :/
user11867329
It's a one time thing
user11867329
to get csv
user11867329
19:09
ill bother someone else to try to run it
>>> multiprocessing.dummy.Pool()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
[...]
RuntimeError: can't start new thread
I yamming give up
it's ridiculous how awful all the software around python is. pip still can't upgrade all installed packages, sphinx's rst format sucks, autodoc is full of bugs, packaging is a mess
At least sphinx is third-party. Pip is...2.5th-party?
is there even an alternative to sphinx though? I'd be happy to give it a chance...
user11867329
k wthell
user11867329
19:20
> File "runme.py", line 5
return zip_longest(*args, fillvalue=fillvalue)
^
IndentationError: unexpected indent
root@instance-1:/home/ed****v/lessgo# python3.7 --version
Python 3.7.3
user11867329
what the hell
root@Starlight /h/aran-fey# python -m pip install --upgrade distlib
[snip]
ERROR: Cannot uninstall 'distlib'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
ಠ_ಠ
@OakDev IndentationError: unexpected indent means it's an indentation error
please stop
@Aran-Fey hahaha :'(
19:23
@OakDev Do you understand what an IndentationError is? We can't help you without seeing your code
user11867329
I posted the code.
I'll take that as a "no, I don't understand"
user11867329
and was told word for word should work and works on my end
user11867329
Yes, I know what an indent is, I don't understand why there's an issue. Probably copy pasted.
user11867329
Will wget and chk
19:24
It might be some notepad space tab thing...? To many error sources on the channel.
@OakDev "probably copy pasted"?
user11867329
which is why i posted the gist
That code is from your gist?
user11867329
Worked with wgetting, so issue was copy paste.
user11867329
> File "1.py", line 34, in <module>
tech = remove_title(tech_paragraph, "TECHNOLOGY\n")
File "1.py", line 9, in remove_title
if s.startswith(title):
AttributeError: 'NoneType' object has no attribute 'startswith'
@OakDev Okay, if you want to keep asking for help here you must seriously work to get rid of these dumb problems that waste our time
user11867329
19:27
I'm going to lose it. Yesterday someone ran it, one-time, no issue.
"I'm trying very hard" doesn't seem enough. Please try much harder.
user11867329
@AndrasDeak kk
Harsh, but I have to agree at this point
user11867329
Hard to pass on that offer, with all the insightful help already provided
user11867329
Now I'm hooked.
19:30
@OakDev while we're at it please review what a help vampire is and how not to be one
AD, I agree as well...
I want to see a company do parental leave for new pet owners, I mean getting a new pet is just as demanding as having a baby, no?
@erotavlas No. lol
19:35
i don't know man, i think the day is coming, pets are king
wim
wim
depends on the pet
A Honey Badger, for example
Needs a lot of attention. Fur gets matted easily.
if they do it for one type of pet it has to apply to any pet or risk being sued for some yet to be invented form of discrimination
19:46
Honey badger just don't care.
also adopted adult pets need much less hands-on time than babies (baby animals, that is)
I want to see time off for release of new video games. /endtroll

« first day (3301 days earlier)      last day (1872 days later) »