« first day (2664 days earlier)      last day (2283 days later) » 
00:00 - 19:0019:00 - 00:00

7:03 PM
arg welp time to go visit the c# room :\
 
DSM
Say hi to Kevin for me. ;-)
 
errrgh. I'm fighting with an ansible plugin I'm trying to figure out
someone wrote an inventory plugin, and I'm trying to see if gets loaded properly. But I'm dealing with import hell
Any ansible people here who have written plugins have a good doc to explain how to understand the import system?
I can draw up a MCVE for those who are interested
 
I've never done inventory plugins, before you ask ;)
 
you were the one person I was hoping for lol
I wasn't going to ask you specifically. But I had my fingers crossed hehe
Thanks
 
DSM
It would have been so much easier to build this numerical model the right way from the beginning rather than to try to salvage things now.. (sigh) Who could have guessed that numerics is a craft and that you can do it badly?
 
7:14 PM
This entire week has been me sifting through code
and so far all I have to show for it are two bad unit tests that don't really test anything
the feeling of failure, discouragement and giving up is high right now
woosh...that got emotional
 
DSM
Monday I accomplished almost nothing. Yesterday I went to two meetings, the first one of which ended with certain people saying "well, keep doing what you're doing, we'll decide later when we have more information, but we won't do anything to get that information and it's not clear what that information will help us decide". Today my main achievement has -- and I'm not kidding here -- been to change the colour of cells in an Excel spreadsheet, from not-coloured to either green or yellow.
5
Productivity comes and goes, is what I'm saying. :-)
 
looking for a good measure for stability of data
 
7:39 PM
back from the land of c#.... they didn't have the answer I was looking for, guess my google fu didn't failed me this time
 
DSM
You-know-who is obviously slowing down since he hit 1M. ;-)
 
Was trying to think of which sport player had a milestone of 1M, but then I realized the 1M was for reps.
 
DSM
1M is a lot. Basketball has the highest scores I know of and nobody ever cracked 40k.
 
well 1M minutes played isn't too hard is it ? (doing some mental math 1M mins on average 20 mins a game yields 50k games at least for hockey)
if it was football and you played the full 90 minutes you can play 11k games but the quick wiki look up yields that the most games played a player has played was 1.2k not even close
so I guess I will yield on that 1M
 
DSM
I checked into cricket 'cause I know they have some incomprehensible scores (500-2 or whatever) but it looks like they still only have O(10k) runs scores for the best players.
 
7:54 PM
90 mins a match for football? Still yields a lot of matches.
 
DSM
Just to mock me, Excel's now saying "Cannot quit Microsoft Excel". We'll see about that.. (calls up Task Manager)
 
> I would like to talk to the manager of tasks
tasked with the task of managing tasks with task manager.
 
@idjaw Thanks for saying something. I'd rather not have my name attached to that. I can be an idiot sometimes (-:
 
heh, as I was leaving c#'s room, I got them on a ramble about Python and Duck typing. my secret mission is a success for today.
 
"Iterate through all possible images" guy decided he wants to generate random images instead. Maybe I'll leave that for the next answerer.
 
8:07 PM
Any opinions on whether I should switch the dup/target relationship here considering the timing? @cᴏʟᴅsᴘᴇᴇᴅ this is your hammer, so chime in if you'd like. stackoverflow.com/q/44367672/2336654
@Kevin random images from the interwebs ought to do (-:
 
The only hard part is he probably doesn't want any repeats. Upside: if he has a really high quality source of randomness, then even without any duplicate-checking he's likely to not hit a repeat during his lifetime
 
We could give him a lifetime guarantee. If he ever hits a duplicate, we'll give him a brownie.
 
By the time his boss finds out, he'll be a skeleton, and you can't fire a skeleton.
 
They wouldn't even have the capacity to determine if it is a dup. The dup would go unnoticed.
His skeleton's job would be safe
 
wim
8:13 PM
heh
 
Bamboozled once again
 
@piRSquared no worries :)
 
Hey, conceptual question: for a large dictionary, if you're going to need to do multiple/many reverse lookups, would creating a reversed dictionary (assuming values are valid types for keys) at the outset be better than continually iterating over the dict, or is there a better datatype than a dict for pairs of values that need to be accessed in both directions?
 
I would use two dicts from the outset.
Somebody brought up pypi.python.org/pypi/bidict the last time we talked about something like this. Might save some bookkeeping.
 
If I have to do a reverse lookup and there's even a teeny tiny chance of my dict ever having more than a single key, I'd use two dictionaries.
 
8:22 PM
If anyone is running Windows, can you run this and report back now much time it takes. I expect ~30 seconds. I run this on Windows at work and fails in 32 seconds. While at home on Mac it takes ~0 seconds. Turns out when the driver is specified as SQL+Server on a Windows machine, it is doing something funny to keep trying to connect to something.
import pandas as pd
import pytest
from sqlalchemy.exc import DBAPIError
from sqlalchemy import create_engine

stamp = pd.Timestamp('now')

with pytest.raises(DBAPIError):
    create_engine('mssql://me:pw@hostless/nodb?driver=SQL+Server').connect()

print(pd.Timestamp('now') - stamp)
 
0 days 00:00:34.513773 running in Spyder.
 
Let's see, I got... ModuleNotFoundError: No module named 'pyodbc'. Guess that's not helpful.
 
pip install pyodbc would fix that... but no worries
 
0 days 00:00:32.179572 running a second time.
 
Thx @toonarmycaptain that is helpful. If you changed the connection string to 'mssql://me:pw@hostless/nodb?driver=blah' it fails immediately
I'm glad to see it is consistent on Windows machines (Mine and yours)
 
8:26 PM
C:\Users\Kevin\Desktop>pip install pyodbc
Collecting pyodbc
  Downloading pyodbc-4.0.22-cp36-cp36m-win32.whl (52kB)
    100% |████████████████████████████████| 61kB 436kB/s
Installing collected packages: pyodbc
Successfully installed pyodbc-4.0.22

C:\Users\Kevin\Desktop>test.py
0 days 00:00:36.516111
 
Thx (-: We've established a well defined rabbit hole of driver=SQL+Server that I'm not equipped to go down at this moment
 
0 days 00:00:00.180496
0 days 00:00:00.001004
...when I change the string to ...?driver=blah'
 
 
1 hour later…
9:33 PM
SpaceX launches almost seem boring when they're not landing anything.
 
Consider this package structure:
└── app_folder
    ├── package
    │   ├── __init__.py
    │   ├── module1.py
    │   ├── module2.py
    │   ├── subpackage1
    │   │   ├── __init__.py
    │   │   ├── sub1module1.py
    │   │   └── sub1module2.py
    │   └── subpackage2
    │       ├── __init__.py
    │       ├── sub2module1.py
    │       └── sub2module2.py
    ├── setup.py
    └── MANIFEST.in
From within `sub2module1.py` I can import from `sub1module2.py` with `from package.subpackage1 import sub1module2`
However, This is an uninstalled package that I'm working on in PyCharm and PyCharm is showing that `sub1module2` is an unresolved reference. How do I tell PyCharm to recognize the package I'm working on?
 
wim
My Python 2 is a bit rusty, should I be using im_func here or __func__?
 
@piRSquared All I can think of is to use relative paths
 
wim
@toonarmycaptain A boring launch is a successful launch
 
@wim But the landings are still pretty fun to watch.
 
wim
9:39 PM
@piRSquared right click on the proj root and look in the context menu
 
Soon that will be true for landings also, I guess.
 
wim
you should have "Mark Directory as" or something
 
TIL you don't need to use global inside a function if the variable you're modifying a mutable variable type (eg dict).
 
@wim Did the trick! Tyvm
 
@toonarmycaptain Yes, you only need global if you're re-binding the name, i.e. doing an assignment to the variable
I've never had to mark anything in PyCharm, it always worked out of the box ._.
 
wim
9:53 PM
My PyCharm also works out of the box, if by "out of the box" you mean doing things in strange and confusing ways.
@MooingRawr another reason to use Python 3 is ....... insane monkey-patching is easier? ;)
 
you know it wim. If someone wants to go crazy, might as well let them do it with ease :D
 
Anything to make getting a patch of monkeys easier
 
In Python we don't govern your types, why would we hinder your sanity :D
that's why I want to petition we bring back True = False :D
 
wim
10:26 PM
hmm, fair enough ... :)
although insane hacks being possible is a double-edged sword
monkeypatching is partly to blame for the dismal state of Python packaging
 
isn't it a single-edged sword with the edge facing the wrong direction?
 
wim
(setuptools monkeypatches distutils, and pip monkeypatches setuptools)
 
if everything's designed well you don't need insane hacks for the greater good
 
wim
yeah, but I'm saying the existence of insane hacks is somewhat an enabler of poor design
 
only if it's relied on
 
10:29 PM
insane hacks allow cool things like pytest to exist
 
A language could have awesome design yet allow insane hacks. But that should then be an interest to code golfers and other madmen
 
lambda: read_mind()
 
Hello all. Does anyone here have any experience with the numpy C api?
 
I want to say "yes" but the answer would've been "no" last week, so I'm probably not your guy
 
Unless the answer is yes relative to {anyone_here} - {@AndrasDeak}
 
wim
10:34 PM
I wonder if 3.7 will add a dict.sort method
Is it already in feature-freeze ?
 
hah, you wish. Even OrderedDict has terrible sorting and indexing support.
 
wim
@Rawing very true
that's the edge of the sword that points away from you ...
 
Aren't dicts explicitly unordered in their implementation?
 
not anymore
and what was it, will they be ordered by specs in 3.7 @wim?
in 3.6 it was an implementation detail of cpython
 
Hey. Is there a canonical dupe target for this type of question? I must see 3 or 4 identical issues a day but I don't know what to point at. stackoverflow.com/questions/48552580/json-parse-python#48552580
 
10:39 PM
There, is but I can't find it. cᴏʟᴅsᴘᴇᴇᴅ wrote something a while back
 
@AndrasDeak yeah
 
wim
they should have just made the guarantee in 3.6
 
@roganjosh found it
 
@wim yes
 
10:44 PM
@Rawing thanks :)
 
11:01 PM
@Kajelad you are aware that you will never find out whether anyone can help you if you don't ask your question, right?
 
00:00 - 19:0019:00 - 00:00

« first day (2664 days earlier)      last day (2283 days later) »