« first day (2447 days earlier)      last day (2505 days later) » 
00:00 - 16:0016:00 - 23:00

12:01 AM
thoughts on why it wont work anyone?
 
wim
12:35 AM
@idjaw opinions differ
if it's a good answer + question, no problem imo
According to DSM you should not close older question as dupe of newer question. I did that once, copped some flak and collected a couple of downvotes on my answer. So some people are touchy about it.
 
1:36 AM
@Jasch1 "not working" does not an mcve make
 
Its not editing the records
And from all of the places I've looked it should work, I'm pretty new to flask though
Any thoughts?
 
1:55 AM
@wim Right. That's what I'm thinking too. I'm noticing a good amount of Counter questions, so I wanted to try to see if I can find a solid one to make a canon for duplicate flagging.
I've answered quite a few myself over the past couple of years...I think it's about time to start duping them.
 
2:46 AM
@Jasch1 read up what makes a mcve
 
I think what was provided is enought to suggest
Theres not much more relating to that part of the project
Its supposed to add a dict to an array field in a record, and it isnt
 
3:19 AM
morning guys
im having a pandas csv problem
im trying to get the last image as result
im basically merging the top 2 tables using Material Name as the common key
any ideas how to do in pandas? I tried using pivot_table and groupby() but i cant get it to work
 
 
1 hour later…
4:32 AM
recbg
@Ming that gets asked a lot
to get material name to code, pandas.pydata.org/pandas-docs/stable/…
with inner join naturally
 
5:08 AM
@AnttiHaapala thanks so should i use merge?
i have read those docs before, but didnt fully understand it
i tried merge but it gave me this
 
yeah that's correct
that's half-way there, now you need to group by firstname, lastname
that's a separatething then
(and you can drop the materialname column
 
the image above is mergedDF
then i tried this
mergedDF.groupby(['First name', 'Last name']).agg({'Material Name': lambda x: ','.join(x), 'Material Code': lambda y: y.values.tolist()})
but i cant get lambada y: y.values.tolist() to work
it managed to merge Material Name but somehow it cant merge Material Code
because Material Code is an int
i tried to str() it but it gave some weird results
am I on the right track? @AnttiHaapala
 
5:54 AM
cbg
 
well, you could try lambda x: ','.join(map(str, x))`
to stringify each individual string
@IljaEverilä cbg
office?
 
@AnttiHaapala Office.
Did you have lunch in mind?
 
going to try out skwiiki today with pete, let's see if @idjaw is right about poutine :P
 
Any particular time, or just "when we're hungry"?
 
@AnttiHaapala thanks very much. that worked
 
5:58 AM
@Ming perhaps write a self-answed q about that lol :)
 
but how did you know to use map in the join? i just used ','.join(str(x))
 
6:20 AM
you need to stringify each individual element.
that's the difference between 5xk and 100ish rep
 
6:45 AM
yeah. will have to read up more on python
 
7:05 AM
Hello guys, I suspect there is a bug in the community package
please check this
1
Q: Bug in community package?

sovonI highly suspect that there is a bug in community package. It in in the calculation in module score. I looked at the Louvain algorithm paper and find some anomaly. Here is the problem- In the equation of Q there is k_ik_j/2m and after after multiplying the outside 1/2m it should be k_ik_j/4 sqr(m...

I just wanna sure that, it is a bug indeed
even though i am 80% sure that it is a bug
 
@AnttiHaapala lol :D
cbg
 
7:22 AM
@AndrasDeak stackoverflow doesn't support tex, right?
Q = \frac{1}{2m}\sum_{i,j}\left [ A_{ij} - \frac{k_{i} k_{j}}{2m} \right]\delta (c_{i}, c_{j})
too long since I last used latex :D
Q%20%3D%20%5Cfrac%7B1%7D%7B2m%7D%5Csum_%7Bi%2Cj%7D%5Cleft%20%5B%20A_%7Bij%7D%20-‌​%20%5Cfrac%7Bk_%7Bi%7D%20k_%7Bj%7D%7D%7B2m%7D%20%5Cright%5D%5Cdelta%20%28c_%7Bi%7‌​D%2C%20c_%7Bj%7D%29
wat
cant paste that to stackoverflow editor
phew
2
Q: Bug in community package?

sovonI highly suspect that there is a bug in community package. It in in the calculation in module score. I looked at the Louvain algorithm paper and find some anomaly. Here is the problem- In the equation of Q there is k_ik_j/2m and after after multiplying the outside 1/2m it should be k_ik_j/4 sq...

@sovon ^
you can use codecogs.com/latex/eqneditor.php to make gifs to embed into questiosn
but yeah, I'd ask about that
 
8:13 AM
Great link for writing equation. Thanks for the needed edit.
 
8:32 AM
cbg
 
8:53 AM
@AnttiHaapala nope
but there's a userscript that does
mathjax, anyway
@sovon I would probably describe the problem in more detail on the github issue page; I would expect that a mere link to an SO question is insufficient (then again this is a small project)
Sometimes it comes up that SO should support mathjax, but the usual response is that it is very rarely used but takes too long to load for the vast majority of cases when it's not needed. I can't really argue with that: 90% of questions that need mathjax are probably blatantly off-topic on SO.
 
9:24 AM
Cabbage!
 
cbg
 
@Kevin I’ve hardened my simple rectangle solution now a bit, so it correctly recognizes the actual rectangle (and not small rectangles within the border of the circle :P), and it performs approximately 15 times faster than your flood fill solution.
 
10:11 AM
cbg
 
cbg
 
cbg
 
question: is immutability "requirement" for functional programming?
 
no, see monads
 
potato?
 
10:21 AM
@poke I mean the variables(afraid to use that word) and arguments
 
Well, in real functional programming, there aren’t really variables
 
for example, can we consider Javascript as a functional language?
or can you write true functional code in JS?
 
No. JavaScript has parts that are functional, just like Python
You can get somewhat close to write functional only code
 
everything can be done in terms of exec calls just fine
 
recbg
So. Yamming. Hot. :( And humid...
 
Does anyone know why this behaves differently in python2 than it does in python3? In python 3 you can instantiate the A class perfectly fine, but in python 2 you can't.
 
yamming summer heat wave
 
from abc import ABCMeta, abstractmethod

class A(object):
    __metaclass__ = ABCMeta

    @abstractmethod
    def __init__(self, n):
        self.n = n
oh nevermind. It's because in python 3 you have to do class A(object, metaclass=ABCMeta).
 
11:37 AM
I'm learning a lot about small differences between python 2 and python 3 today... I haven't made myself look this stupid in a while.
 
it's python 2's fault, really ;)
 
cbg
Guys is there anyway of running a:
def
Command
Inside a different class
 
???
 
^ what Andras said.
 
please try to put together a coherent question, I have no idea what you're asking
 
11:51 AM
I mean you know how you have classes
Sorry
 
a simple pseudocode example can also do
 
are you trying to add a function to a class that already exists?
 
no
 
I think we should wait until he tries to explain
 
Yeah please
 
11:52 AM
it might be better if you write it up separately, and once it makes sense you can paste it here:)
 
rbrb
 
rhubarb
 
So I have 3 class/Object thing and I was wondering if you are able to run a def, from one, In a different class.
So like class one has a def and I want to run that def from class two
You Get me?
 
You mean calling an abstract method of class A from class B?
 
What do you mean by that?
 
11:55 AM
*A class method
A method that is accessible with the class (A.method), not from the instance (self,method)
In other languages are static methods
 
I think that's what I want...
Honestly I only know a little about classes and objects
 
These questions make little sense.
 
my gut instinct says "it's possible but doing this is a sign of bad design"
 
Oh ok
 
53 secs ago, by Jake
Honestly I only know a little about classes and objects
 
11:57 AM
You've got a thing you want to do - then we can suggest how to achieve it in the best way possible
 
So why are you asking this? What is the X to your XY problem?
 
I could just copy the same code over and change the name that would be simpler
 
or define a base class and inherit from that?
 
Guys you should probably check out my profile before sending these questions stackoverflow.com/users/7757018/jake?tab=profile
 
if you want Cat to walk() and Dog to walk() with the exact same code, it might make sense to have a Mammal that walk()s, and inherit both from that as subclasses
@Jake "How can I accelerate muons to ultrarelativistic speeds? Oh, in simpler terms, I haven't taken any physics!" ;)
 
12:00 PM
:)
 
You should try starting learning some OOP. en.wikipedia.org/wiki/Object-oriented_programming
 
@AndrasDeak Always googling makes me forgot that that link exists
 
it comes up a lot...
which is not inherently a bad thing; the bad thing is that some people need to be told multiple times before they pick up a tutorial
 
Guys do bare in mind that I am in Year 9 Coding at School!
 
12:04 PM
When I learned some perl in ~8th grade I read a tutorial. Just saying.
 
Oh
 
regardless of age, the process of learning is the same
the only difference is that in time, following several sessions of learning stuff, it's easier to learn new things and there are fewer new concepts
 
Yeah Its just half the stuff you've been saying I had no idea of what you were saying
 
unfortunately if you're trying to write classes, and are asking about classes, you should learn about classes
and you can't "just learn python classes" and be done with it
 
Oh ok
I have managed to understand some of it like I know how to set a class as the active one and stuff but your probably right
GTG
 
12:09 PM
rhubarb
 
rhubarb
 
I started programming when I was 9-10 years old or so.
lol, I am reading code that I wrote when I was in ~grade 10, awful :D
 
12:29 PM
BOOM
just like that...whaddup san room6co
 
cbg, slayer
 
0
A: Cannot write full HTML into the PDF

RompePCOk, so finally, with the help of another programmer, I found the issue. It looks like PDFKit, when processing a large amount of HTML (in number of PDF pages we're talking more than 349 more or less), sends progress bars comments to the buffer to see how it goes. Then, when it finish, also sends ...

 
@AnttiHaapala i wish I kept my first ever program
C# game like snake
it was horrible
 
12:50 PM
@khajvah these are nowhere near the first tho
 
morning cats
 
@khajvah look at this fli player :D paste.ofcode.org/VaAzpPY6Xn259x5gB2sqG9
how clear is it, not a single line of comments.
 
1:17 PM
cbg all
 
@AnttiHaapala what is that
lanagugae
 
1:27 PM
folks, do we have a good canon "count frequency of <things>" that ultimately result in using Counter as the answer? There is this
do we feel it needs updating or anything? The SO answer from Martijn seems fairly complete as is.
I just noticed that I've been answering those counter ones, and quite a few came up recently. I think it's time to start squashing them as dupes (well more me starting to squash them)
 
1:43 PM
\o cbg
@idjaw before you run away to do more important things, thoughts on McDavid wanting 14 mill a year?
 
he's worth it
I'd give him 100 million
especially if he pops up with more awkward pictures
 
But do you think the Oilers can build a win-able team with that much money going into one player?
Him and <I forget the other dude's name atm) would be around 23% of the salary cap of the team
 
The Oilers are finally making things work, and McDavid could be their franchise player.
This is pretty much a must do in my opinion. This is up there with the Pens keeping Crosby, the Caps keeping Ovy
but keeping in the sense of back when they were very early in their career just like McDavid is now.
 
Crosby was asking for 12 mill (IIRC) but settle for 8 knowing this will allow the Pens to bring in better players like Kess (81) , and he knew he would get sponsorship from third party source. Same with Ovy... (But I think Ovy at 9.5 mill a year.
But once again just curious on what you would do, and what you would want to see.
 
12 to 14 is not that big a jump...so to me it seems like an OK ask
Also. I don't know what natural inflation from back then to now would equate to the equivalent
 
1:49 PM
I guess that's a fair point
 
maybe that 12 million back then is the 14 million now.
 
so he should sign 10 mill per year ?
 
Maybe the Data Science Man might have the answers to this :P
 
I hope Matthew doesn't ask that much money either ... I know I should have waited for DSM to come in....
 
1:51 PM
I saw that on Tim and Sid :D oh god that photo ...
 
amazing
I think it would be absolutely hilarious and amazing if EA actually did this.
They won't....but they would make a lot of money because people would just want to buy it to own that cover.
 
I heard McDavid got asked about that photo, but I never got to read/see the answer he gave :\
 
@MooingRawr here
 
Joe
Going crazy with django. Anyone here have those django skills? stackoverflow.com/questions/44077091/…
 
I chose not to have Django skills, and my life is better for it.
 
Joe
1:56 PM
hahaha
 
@Joe You might want to state your Version and what not, I have very limited Django skills too :( sorry
 
-1
Q: 'utf-8' codec can't decode byte 0x96 in position 227: invalid start byte

ArielisI am starting with Django. I've got an error but cannot sort it out. Does anyone know why I am getting this? I am doing an {% extends "base.html" %} on my login page. I get this error:

 
@RompePC wrong person to reply too :D You wanted Joe I think...
 
-1
Q: 'utf-8' codec can't decode byte 0x96 in position 227: invalid start byte

ArielisI am starting with Django. I've got an error but cannot sort it out. Does anyone know why I am getting this? I am doing an {% extends "base.html" %} on my login page. I get this error:

@MooingRawr In your insides, you're Joe, you know it
 
Why am I being pinged?
 
2:11 PM
GOD WRONG PERSON AGAIN
 
He got the wrong person.... again... you can edited your message @RompePC within 2 minutes of posting. You can also delete the message too :D
 
I did
 
Enjoying this album: kidkanevil - My Little Ghost
 
2:26 PM
@AnttiHaapala OMFG
I couldn't find my irc kick script I wrote in perl, one of my first "programs"
I found some references to it in ancient emails of mine, so I could google a method name
turns out someone pasted it to pastebin last month, what the hell :D
I uploaded it to some big online script repo ages ago
 
Good code never dies young :D
 
I don't know about good code :D
sub BEGIN {
    IRC::command("/echo  \n%C3,1#####################################");
    IRC::command("/echo %C3,1#\002Ultimate kickmessage writing script\002#");
    IRC::command("/echo %C3,1###########\002By ANDRAS DEAK\002############");
    IRC::command("/echo %C3,1#####################################\n ");
    return 1;
}
lol this is amazing :D
 
So beautiful :D
 
the fact that this was uploaded last month fills me with immense curiosity
 
The kickmessage writing script to end all kickmessage writing scripts
 
2:33 PM
@MooingRawr but shit code can live forever
 
I can't remember if I was 13 or 14...something in that range
 
morning cbg
 
cbg
 
cbg
 
Joe
@RompePC I looked at that link but that really doesnt apply to my situation. There are no special characters
 
2:59 PM
@Joe Try changin LANGUAGE_CODE in the settings and/or setting L10N = False. Although I've some skill, I never had this type of error.
@Joe Also, check that the data in your db is correct
 
argh....sometimes PyCharm really really pisses me off with its anal behaviour when attaching different SDK versions to your project.
 
IANAL but
 
wim
3:23 PM
@idjaw too verbose
imo canon dupes should be short, concise, to the point,
all the crap about defaultdict , dict.setdefault, blah blah ... who cares
 
I have this and here are a few I already answered related to collections counter here
let me know if mine would be good enough for canon dupes.
I don't mind throwing them in the bucket
 
wim
6
Q: Count occurence in a list with time complexity of O(nlogn)

D.X.DThis is what I have so far: alist=[1,1,1,2,2,3,4,2,2,3,2,2,1] def icount(alist): adic={} for i in alist: adic[i]=alist.count(i) return adic print(icount(alist)) I did some research to find out that the time complexity of list.count() is O(n), thus , this code will be O(n^2...

 
ah. That's a good one too!
 
Yup. I guess we need to now decide which one wil be the chosen one
a worthy sacrifice to the mighty hammer
 
3:30 PM
So I basically know everything there is to know about python
learned it all in 2 days
 
oh right I'm only allowed delving questions not answers at my rep level (I was wondering why I couldn't)
 
wim
the question and 2 answers are good there, but there are 5 crap answers from low rep n00bs
I think that one is the best choice, if we can get the noise removed
 
yep. everything below the one with the 13 votes
 
wim
"Cat Plus Plus" has a hilarious avatar
 
3:36 PM
14 now 😛
lol
monocle cat
 
wim
3:46 PM
@idjaw ur from montreal ?
 
> Principally change "principal" to "principle" on the principle that the principal requirement of documentation is accuracy. Sundry other minor tweaks.
 
wim
so-documentation .. #unsubscribe
 
@AndrasDeak remember, I had been programming for 5 years already :P
 
Hey guys!
I have a question that has probably been answered before but i dont know how to ask it.

I got an application that has to make 2 big queries to the database. As the client won't have a good internet connection, leaving it to wait for 5 seconds for the query to end every time the function is called, i was thinking on having the database process the query I want it to make, save it and then at a later time ask for it (just asking would take almost no time).

How can I have a sql query to be "queued" but it not locking the function i have?
 
no autoformatter in TurboPascal 6. Nor PEP8. At least I did indent :D
@AndrasDeak see, I even indented assembler there! No one does that!
everything is horrible spaghetti of course...
I didn't read about OOP patterns when I could get to internet... Instead I was downloading programming tutorials, libraries and articles ... and saving them to floppies :D
 
3:52 PM
Something like...
query1 = "SELECT ...."
query2 = "SELECT ..."

execute_queryies without waiting for it to finish
return whatever
 
@TomasWolf the problem is that to parallelize these 2 queries you usually need 2 sessions and 2 database connections
if you want to execute them sequentially but parallel to everything, you could use threads.
sqlalchemy could help you a lot
 
im ok with making them sequential, the only thing is that i dont want the main application to be waiting for the queries to finish
what do you suggest i google to make it?
I do use sqlalchemy but dont really know much about it
 
If you need the queries for the response, then you still need to wait for them no matter what. And perhaps the queries could be optimized instead. I'm going to echo the sqlalchemy recommendation
 
actually my solution is to get the queries response on a table, and on a completely different point it will be retreived
I need to make a giant geographic query to get closest points, and it takes too long to wait for it on real time, thus my intented solution of getting the query done and saved on a different table, and ask for the results later
 
00:00 - 16:0016:00 - 23:00

« first day (2447 days earlier)      last day (2505 days later) »