« first day (2240 days earlier)      last day (2702 days later) » 
00:00 - 19:0019:00 - 00:00

7:00 PM
But it's not a subclass, it is OSError.
 
DSM
Classes are subclasses of themselves, though, no?
 
wim
hah, right you are
>>> socket.error
OSError
 
@DSM ok, strict subclass
 
@wim I don't get it, if both have the same base, issubclass will return true right?
 
wim
no!
hard to have that because it would be a circular dependency
although, type / object did it somehow
cpython sleight of hand probably
 
DSM
7:03 PM
I guess I'm not quite seeing the issue here.
 
wim
>>> isinstance(object, type)
True
>>> isinstance(type, object)
True
 
so what's the hierarchy now?
 
wim
I don't know if that's ever possible with issubclass unless they are literally the same class
 
welp
 
@DSM I can't find the issue right now, but there was a big discussion in Werkzeug/Flask because some socket errors stopped being handled right and it was really hard to detect.
 
wim
7:05 PM
I guess you have to dig in errno
fun fun
 
> In fact, it is hard to think of any situation where OSError should be caught but not IOError, or the reverse.
doesn't this mean they are the exact same thign? :D
 
Giving up on GitHub, crazy
 
wim
what/
github kicks butt !
Does anyone know what timezone AoC is in?
 
I can never get it to work -- too much of a pain
Should be simple
 
I find it simple as well
wat
I have to write 20 page paper about mongodb
my professor is drunk
 
7:17 PM
@wim I think it's EST, but I may be wrong
 
Oy, finally
 
DSM
Yeah, it's EST, or at least each day starts at 12:00:00 AM EST.
 
@khajvah just use one massive example?
@idjaw did you end up getting that working?
 
I just complete day 1 part 1 and now part 2 I have to start from scratch I think...
Is this typical?
 
wim
no
 
7:28 PM
Depends on how you implemented part 1
 
wim
if you write part 1 well, part 2 is trivial
 
part 2 was really easy to add to my part1 for the first day
 
DSM
If memory serves there were quite a few who tried to be a little too clever in part 1 and whose tricks didn't generalize to part 2.
 
if you wrote a loop like the python heathen I am, it was easy to add :)
 
yeah I didn't keep track of my position, I just kept track of total distance in each direction.
 
DSM
7:32 PM
From the evidence of last year, making it easy to store intermediate or path information will continue to come in handy.
 
@enderland Had to go do yard work.
The few weekends my wife is not working that gives me time to go do work around the house
 
Good to know. I hope I manage to get through at least a majority of the problems :P
 
@idjaw Ah, nice. I'm trying to decide whether I should just hope that my cars parking brake magically releases in our garage or if I should go buy a jack/jackstands and try to help it release...
 
your parking brake is stuck?
 
I think so
neither back tire spins
though I will say, I was a bit loathe to really gun it forward or backwards in my garage :P
I'm assuming the parking brake is stuck
the little I did dragged the back tires without them moving, so I'm pretty sure it's the brake that is stuck
my wife drives a manual normally so she's used to setting it even on an automatic
 
7:36 PM
yeah. I always put the brake on.
 
I just don't own a jack since we only recently moved from a 1br apartment, so the DIY solution is going to be an expensive initial investment..
 
yeah. Familiar with that. We recently moved in to a new house, so we are doing a lot of first time purchases for things that have to get done.
$$$$ fun fun fun
 
car expenses in the past 6 months are a bit high over at the enderland-household
I kind of figure that if I'm pulling off the back wheels anyways I might as well replace the back drum brakes, too, but... more $$ meh
 
Well, that was exciting
Last couple of days my ISP was broken so I couldn't access SO :(
 
DSM
Oh noes!
Mostly my phone data plan is for checking scores, but there are definitely a few times I've had to use it for home connectivity. :-/
 
7:49 PM
A few years ago when I was waiting for my internet to get connected when I moved, I was using my data plan as regular wifi
Also good during power failures
 
my wifi is my data plan, basically :/
 
8:30 PM
I am not meant to do any AoC. I haven't been able to have a solid 15 consecutive minutes to do this and now time to go out with the family
 
DSM
Maybe it's a sign your priorities are properly ordered. :-)
 
Heheeh
 
wim
9:03 PM
Just swapped 50 raisins for 100 sultanas. Can't believe the currant exchange rate!
 
I thought I was being tricky again and I misunderstood the question. This is not off to a great start for me lol
Okay officially complete Day 1. I'm satisfied for now lol
 
9:46 PM
@AnttiHaapala yeah, it was great:)
recbg
AoC private leaderboards now support links
 
9:57 PM
@AndrasDeak did you solve it
 
@AnttiHaapala partly:D
it was buggy in places, and some of the puzzles were underhand
 
Okay I was kidding, done Day2P1. I'm ready for rework now
 
10:16 PM
cbg! Can someone lead me to a proper way to break down a large python procedural code (with lots of functions) into modular(multiple python files) code? A good guide or something like that.
 
@AndrasDeak ahh
 
10:45 PM
cabbage
 
Is there a way to minify HTML in Python Google App Engine?
As far as I know their PageSpeed is already deprecated, so that method for minifying doesn't work.
Any other ways that can be suggested here?
 
i have a problem that's been bugging me for a long time - how to do two calculations that depend on each other in such a way that there are no errors. basically, let's say i have calculation one, which takes in a user input, and records an already existent variable in another variable. other calculations are performed. then, after the first calculation is finished, a second one starts, which takes in a user input that matches with the earlier one.
it accesses the previously filled variable, uses it to apply some calculation depending on the variable, and then moves on. now imagine that inst
 
cbg, @heather
 
@AndrasDeak, cbg
 
I would say "you should formulate your code in a way that you always know what is happening and what is filled" but that wouldn't be anything new;)
what you seem to be talking about sounds like async stuff which I'm unfamiliar with (but still don't think you need it, for the record)
 
10:52 PM
@heather Can you give a more concrete example (i.e. show some code)?
or pseudocode even
 
@Code-Apprentice, here's the github repository I'm working with
the second part of the code controls the 2-qubit operations
it's in python 3
 
minor note: you could simplify a lot of those fstgat logical branches using a dispatch dict
 
line 164 through line 182 and line 225 through line 243 are the relevant lines
@AndrasDeak, okay, I'll look into that.
 
something like {'Hadamard':hadop, 'X':xop, 'Z':zop} etc, and just index into that dict with your fstgat
 
oh, really? That'd be a whole lot easier
 
10:55 PM
(taking care of invalid input)
 
I searched if BeautifulSoup would do but I guess it does the opposite.
 
fundict = {'Hadamard':hadop, 'X':xop, 'Z':zop} #etc
if fstgat in fundict:
    qstat = fundict[fstgat](qstat)
    done2 = input(...)
else:
    pass #handle non-trivial and custom cases
 
@heather FYI, if you highlight lines on a GitHub page with code, the URL will update to show the highlighted lines...copy and paste directly without having to explictly state line numbers in chat.
 
I'm going to try this SO link
0
Q: Shortening HTML files

averagemanIs there a library (preferably a Python one) that shortens an HTML page? By that I mean that it will produce a possibly smaller (in terms of number of characters, including line breaks <- think about the length of a string) HTML page that is rendered exactly the same as the original one? For ins...

 
@Code-Apprentice, okay, thanks for the tip
 
11:04 PM
Adding to @AndrasDeak suggestion, the non-trivial and custom cases might also be refactored into callables (functions, etc.) and stored in the dict.
 
@heather what's with the 1+cmath.sqrt(1) bits?
 
and done = input(...) and done2 = input(...) can be moved to after the respective if statements to avoid so much repetition
sorry, I know that isn't addressing your original question. Still looking into that.
 
aren't both 1+cmath.sqrt(1) and 1-cmath.sqrt(1) just 2+0j and 0j? Did you mean sqrt(-1)? Even then, you can use native 1+1j, 1-1j
 
@AndrasDeak, hmm, its been a little bit since I looked at that part, I'll look into that. Thanks for pointing that out!
 
sorry for not concentrating on your actual question but I persistently don't get it:)
 
11:07 PM
@heather Can you describe a simple example of user input and execution order that illustrates the trouble you are having?
 
@Code-Apprentice, from the beginning, for example, do "2", then "0", then "target", then "X" and you should start having problems
because it will say, okay, we have two calculations, so it initializes two variables for their state, then 0 sets their state to 0, then target says that the first calculation depends on the second calculation (i.e., the first calculation draws on the second calculation's variable) and the X controls the type of calculation that is to be done depending on the second calculation.
 
Where in your code are the "first calculation" and the "second calculation"?
 
the errors should be something along the lines of "using variable 'mem3' before assignment"
the first calculation is represented by fstgat and the second calculation by scndgat
 
@heather I used the exact input you gave in a test run of your code. No errors yet.
 
11:20 PM
@AnttiHaapala userscript?:D
 
@AndrasDeak nope
that'd be poke
 
@Code-Apprentice, that's weird...it isn't highlighting the lines of code saying there's a problem or anything? Because I get that error.
 
I ran from the command-line. You are using py3, right?
 
yep, py3
 
11:23 PM
I also didn't answer the final question in the gist I linked above with the output I have so far. Should I type "y"?
 
yes? I'm just confused that you aren't getting the same problem.
 
did you both run it independently, on in the repl, or ipython?
 
So sad to still see people cargo-culting sys.setdefauktencoding(). Latest example I found: stackoverflow.com/questions/28544686/…
 
11:40 PM
How does one install htmlmin in Ubuntu?
 
@heather yes, that is strange
I cloned your github and ran as-is.
 
I did sudo pip install htmlmin
 
brb
 
@heather No error after typing "y", either. Now it is asking about the second qubit.
One design suggestion: get the input from the user to set up the quantum circuit and store this in a data structure. Only after the user has finished with all input, then run the simulation.
If I understand correctly, you are trying to do the simulation in between user data entry. Is that right?
 
I think it's something like that, that was my impression from earlier
but there was some reason why heather didn't seem to be able to do this detachment...
earlier discussion starts somewhere around here, it seems to me that this one is closely related
Oct 30 at 21:18, by heather
well, it isn't so much that the operations are "heavy", it is just a little matrix multiplying with numpy, but that the variables need to be set at the same time such that the variables aren't undefined when I run the program.
Oct 30 at 21:42, by heather
@AndrasDeak, yes, exactly, and the questions about the manipulations on state 2 are asked after the state 1 questions.
something like these
this is essentially what @Code-Apprentice suggested now
I convinced heather that they should rewrite their code along these lines:P
 
11:56 PM
I am getting an error
`TypeError: unicode argument expected, got 'str'
`
This is my code
import htmlmin

html = """
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Case</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
 
@Ralf17 lrn2gist =p
 
@Ralf17 minor note: are you using python 2 for a good reason?:)
 
Yes, I am using Python 2
 
I can see that
 
@AndrasDeak Heh, I didn't realize I jumped into the middle of an on-going discussion...or at least I didn't realize it was so extensive. Didn't look at previous chat history at all.
 
11:59 PM
What is lrn2gist =p?
 
@Code-Apprentice you shouldn't have, it was back in October
but since heather is a bit away, I thought I'd help you catch up in case you're interested
 
00:00 - 19:0019:00 - 00:00

« first day (2240 days earlier)      last day (2702 days later) »