« first day (2969 days earlier)      last day (1982 days later) » 

12:06 AM
@VictorNogueira you already have two answers
 
I can't see how to use any numpy magic when the data is pairs of numbers. Maybe try a different calc/function ... Fast Haversine Approximation (Python/Pandas)
 
 
1 hour later…
1:34 AM
What should be the dupe target/canonical for questions about Python 3.x integer multiplication performance? I just saw Why is 2 * x * x faster than 2 * ( x * x ) in Python 3.x, for integers? and then found Times-two faster than bit-shift, for Python 3.x integers? while searching.
And there are many others. I tagged both , since they're only asking about that. Neither is great. The former could do with using timeit and comparing to 2 * pow(x,2) and 2 * x**2. The latter could do with showing code on line 1 and stating the actual question upfront, not incorporating-by-reference the sorted_containers package, which is pretty irrelevant.
Actually I guess the ideal target would compare integer multiplication, bit-shift doubling, pow(), exponentiation, integer division //2, bit-shift halving, on 30b, 32b, 64b integers, across something like Python 3.7.x (current), 2.7.x (current) and maybe one of the older 3.x versions if that makes a difference.
And I guess throw in some timings for numpy too. Version of numpy may also matter.
 
 
1 hour later…
2:50 AM
man, I totally forgot that AoC was today until like 3:30... and then I did my AoC on my phone :D
at least the first part
 
3:06 AM
what! it's available now?
 
December 1st is today
 
bah... I thought it would be ... bah be back in a bit, busy
 
3:25 AM
better than a poke in the eye
So I was right in remembering 9:00 pm PST but I forgot that the first day was yesterday.
So I have another one in 90 minutes
 
 
2 hours later…
4:59 AM
@wim your lib doesn't work with new aocd 404 response
 
5:14 AM
get_data(year=2018, day=2) works for me
 
@piRSquared works but not before midnight
ah nvm, my fault :d
it behaved similarly last year; only, my runner was calculating towards 2017-12-DD...
bwaah
68 is the lowest score on the leaderboard.
mine is 64 :F
totally scr*wed part 2 by not reading correctly :d
 
I read it correctly )-: just slow tonight
Like most nights
@AnttiHaapala you're not on wim's leaderboard?
 
5:32 AM
@AndrasDeak yeah, I literally just remembered it exists after posting it, which is bad of me so I deleted it at least
 
6:08 AM
lol shameless self promotion ... ive been toying with ideas for portfolios ... and today i made this thing 198.100.45.105
I suspect people here might enjoy it :)
(dont use a phone for it)
 
Hmm... your flashing green box seems to radiate off centered, I mean there's a bit of white area that the flash doesn't cover
 
lol
ok :P
meh i nerded out just today on it
did you click it?
 
tab-completion inserts an extra space.
 
I clicked it!
 
oh you are right though about the block thing being off ... more than i thought :P
 
6:16 AM
Played the adventure game, got lost and gave up :P
 
yeah i know about the tab completion :P thanks though :)
 
hmm I got to a state in zork where C:\> prompt will display at the bottom of the screen occasionally
 
its just pypi.com/adventure
 
pressing enter
 
yeah ... its over a websocket
and i think there is some bugginess when its delayed
 
6:17 AM
should result in a new prompt without errors :d
 
hehe
yeah I agree :)
 
volume id is not funny enough
 
its basically a day and a half of work on it :P
i know
do you think even non-technical people would be able to handle an interface like this? or its too hard?
I should just use my actual volume id
 
no, they won't
 
6:20 AM
people don't know the black box any more
 
theres hints and things :P
yeah im worried even this simple interface is too much
but i just fell in love with it from a portfolio idea standpoint
 
the thing is they can get up to the dir
after that theyre lost
they don't even know an exe is a program.
nor that you can type the name to execute
 
oh and it probably breaks for really hardcore ppl that try ./asd.exe
if i added a bit about typing a program name to execute it to the help? and maybe to the error message it would help?
i made it in a way that i thought non-technical people could feel "technical" like a game almost ... but im worried its too much and i think antti is right
@coldspeed the adventure game is just pip install adventure but im serving it on a websocket :P
[CONSOLE FEEDBACK]Hello
Inbox
x

joranbeasley******
10:15 PM (14 minutes ago)
to joranbeasley+consolefeedback

FROM: antti.haapa*************

does this work?
@an
@AnttiHaapala
 
6:45 AM
hehe
 
wim
7:02 AM
I didn't get a chance to look at AoC yet - lib still working or no?
@JoranBeasley nice
oh man the AoC descriptions are getting longer every year. Do you guys read all this text, or just skip down to the tests? :D
 
I didn't read the question >_>
 
I read. The story is gripping
and yes the lib is working
granted, I used get_data not data
 
wim
7:18 AM
I'm doing the puzzles now. lib seems working fine sofar
 
 
4 hours later…
11:27 AM
Anyone?
Cabbage
 
12:00 PM
Cabbage
 
 
5 hours later…
4:48 PM
Day01... Welcome to AoC! We're going to perform a little test. We want to see if you have a pulse... Good! Day02... Welcome back! We found a pulse, true. But that could've been faked with pneumatic pump of some kind. Now we'll check for brain activity. Day03... Now let's try something a little dangerous. I can hope, can't I.
 
5:20 PM
Hey got a question, on how to solve a sudoku puzzle with recursion
 
Do you get a prize for posting the most late answers?
 
Prof gave us this pdf, but I'm having a hard time understanding :/(recursion is one of my weakest skills in programming)
 
@Dsafds what is giving you the most trouble?
 
@wwii Honestly im trying to understand the concept of how to do it. Once i understand that it is easy to code it
 
Does that even qualify as recursion?
Ah okay
 
5:33 PM
Recursive in the sense that the function calls itself and each iteration reduces the *sample*(?) space. But would it build up a chain of operations?
 
@wwii Oh i understand now! You pretty much check for every number if its valid, and place the number in if its valid. Recursively.
 
or like this
@Dsafds - figure out the base case and write it first.
 
@wwii if end of row and col, return(means finished). if no number fit the specific row and col, return(means board isn't right).
 
I've only done a few Sudoko puzzles - not sure I could easily write an algorithm*. I would start by writing the process down on paper using words and look for the point where it repeats operations.
 
Why doesn't dir(PySide2) return QtSql? It imports without error.
 
5:48 PM
@wwii Yeah, defintely what i will do. Thanks a lot for the help!
 
6:17 PM
cbg
 
6:37 PM
@jamesson submodule perhaps?
 
6:52 PM
Recommendations for a more user-friendly and intuitive VCS than git?
 
git :P
are you bothered by the fundamental logic or the weirdness of the actual commands?
 
both
why do I have to google and type git diff foo~ foo just to see the changes I made in commit foo?
 
thanks wim :)
 
it exposes way more of its internal functionality than I care about
 
my ide just does that for me
 
6:56 PM
every now and then there are circumstances that make me use git from the command line :(
 
wim
@Aran-Fey huh? that's git show foo
 
right you are
let me find that SO answer where I got the git diff from and downvote it...
 
yup, what he said
But there are weird things when it comes to commands. What I love is the underlying logic. It seems really simple and effective to me
@Aran-Fey perhaps you'd be more comfortable with it if you were only using it via the command line
guis make you dumber
 
any idea how I would list only the added/removed/changed files (and not the content of the files)?
 
"only" or more or less only? --name-only for that git show does mostly that
do you want to parse the result?
 
7:06 PM
--name-only seems to do what I want, but I've yet to test it on a commit where files were removed or changed
 
OK, because if you want to parse it you should use something else
 
wim
I've probably posted this here before but the git koans are an entertaining read (poking lighthearted fun at the esoteric interface and commands)
 
I want to parse the result with my head, not with code (:
 
OK :)
 
@wim I guess they're humorous if you're familiar with git, but for me they just make me more determined to try something else...
 
7:23 PM
I’ve been pushing code to a repository for the first time these past few days for AOC. I’m using the command line. The last push I tried I was denied because of incompatibility. The only thing I can think of is that I deleted a file via the web interface and that caused things to be out of sync. How do I “re-sync” my local if I’ve changed something via the web interface?
 
If you wanna fix it, it would probably be a good idea to give us the exact error message... if you don't care, force push (:
 
I'm trying to sort through the git pull syntax now, but the error is as follows:
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/dodge-ttu/Advent-of-Code'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
 
git push will only be what you need if you want to overwrite what you have on remote with what you have on local. Your original question sounds like the opposite.
 
I want to push local no matter what. Local is the "correct" version
 
I see
 
7:29 PM
well, if you're sure that the remote version has no useful information then force pushing should be an acceptable solution
 
In that case I think you can git push master:master or something like that in order to make it clear that you want your current master to become the master on the remote. Force switches may or may not be necessary. If it won't budge (in order to make sure you don't lose work) you can first delete the remote branch and then push there.
I don't remember which one worked the last time I did this
but odds are there's an informative Q&A out there with 5000 votes on the subject
(the reason why I remember using from:to syntax is because that's the same way you'd delete a remote branch)
 
Okay, thanks for the help, as always. I think I got it figured. I'm dumb. I just needed git pull https://github.com/dodge-ttu/Advent-of-Code then git push origin master. Exactly what the error message said but just needed correct syntax.
 
but git pull integrated the remote changes to your local copy first
i.e. what you deleted via web is probably deleted now locally
 
Oooh, could have been bad then, yikes! The only change was a remote deletion but dang. I could be crying now if I wasn't so lucky
 
the point of git is that you don't have to cry
 
7:35 PM
can not confirm
 
I mean due to lost work :P
 
S..
7:54 PM
Guys question!, so I have a function in python where I modify a Dict; works perfectly, problem comes when I use unittest. My function is supposed to modified said Dict but the way I did it was to create a new dictionary and say that old_dictionary = new_dictionary; well of course both have different ids so unittest will always fail. What do you guys think? should I rewrite this function trying to modify the dictionary again instead of making a new one? or how can I make their ids same?
 
old_dictionary = new_dictionary won't change the dictionary in the calling namespace
old_dictionary.update(new_dictionary) will
 
S..
lmao I'm an idiot, thank you!
 
I don't think I've ever seen a (good) python function that modified an input value, so you should probably rewrite that so that it returns the updated dict instead
 
yup ^
 
recbg
... imagine if sin x changed the value of x... :D
 
S..
7:59 PM
Muahaha well I did this: old_dictionary.clear()
old_dictionary.update(new_dictionary)
working good now, thank you guys
 
@AnttiHaapala yuck? Have been looking at my github, again :)
 
8:15 PM
I was hoping to find awesome solutions for today's AoC part 2 on github and then I came across for id1 in ids: for id2 in ids: ... :(
 
at least I only iterated each pair once :P
 
Did you not join wim's leaderboard or am I blind?
 
yeah, I'm looking at Marcus' from last year
 
S..
@W.Dodge he didn't like my solution I guess
 
@Aran-Fey I’ll swallow my pride and ask, what is the idiomatic way to compare the ith item in a list to all other items in the same list? You have to get each item in a loop and then loop again to compare...
I know that sort of thing is wrong but now would be a good time to learn from mistakes, ya know. (I made that exact mistake in case you are wondering)
@S.. We crawl before we walk
 
8:29 PM
If you want to compare each element in a list to each other element, you can use itertools.combinations. If you really want to compare exactly the ith element to each other element, I honestly don't know a nice solution
>>> list(itertools.combinations('abc', 2))
[('a', 'b'), ('a', 'c'), ('b', 'c')]
^ kinda like that
 
@AndrasDeak, no, QtSql is not a submodule of PySide2.anythingwhatsoever
 
Why do I always forget about itertools when the bullets start flying
I did remember to use itertools.cycle for my day one problem 2
(gives self pat on the back)
 
@W.Dodge: sans serif bullets? Or comic sans bullets? =P
 
@W.Dodge Probably because all they do is putting two lines worth of for-loop into one line of hard-to-debug code
 
@jamesson Ha! I laughed
 
8:54 PM
@jamesson I meant that from scipy import optimize works, import scipy; scipy.optimize doesn't. You need to import it separately
 
@AndrasDeak I was referring to my earlier question regarding dir(PySide2)
 
no kidding :P
 
@AndrasDeak: are you saying dir(foo) is not guaranteed to return all contents of foo? Is there something that is guaranteed to do that?
 
>>> import scipy
>>> 'optimize' in dir(scipy)
False
>>> scipy.optimize
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'scipy' has no attribute 'optimize'
>>> from scipy import optimize
>>>
what I'm saying ^
which might or might not explain the behaviour you see
 
@AndrasDeak: so I'm right. dir(foo) is not guaranteed to list all contents. How can I guarantee this?
 
9:05 PM
Depending on your definition of "all contents" of course you are right, since you can have something in your namespace that is not included in the dir earlier. You don't need me to tell you that.
 
So is there a command that guarantees a recursive listing of contents? Point being, I'm kinda tired going back and forth with the PySide2 docs. I'd rather just dump the contents into a file I can search.
 

« first day (2969 days earlier)      last day (1982 days later) »