« first day (2025 days earlier)      last day (2922 days later) » 
01:00 - 16:0016:00 - 00:00

4:12 PM
"Bug updated by Mike Thrapp"
orly, Mike?
 
It's Dennis!
 
Huh.
I have no idea why my father's name is associated with my account.
 
DSM
Fizzy has a thing for digging up people's True Names, don't you, Fizzy? :-P
 
Hi guys/girls, I made a class, imported this one in another file and initialized an instance of this class. I altered the state of this object but I don't know how to save the state. Or is this normal in python?
 
What do you mean save the state?
 
4:18 PM
Say I have a class Horse with variable Legs = 4. In another file I import Horse and change his number of legs with a method that is located in Horse. I then try to print the number of legs but it still shows 4.
 
@Stanko That's because a horse can have only 4 legs according to the logic of Python
hahaha
 
Thought so :)
 
Take a read through this. See if it helps. stackoverflow.com/questions/1680528/…
 
Ok thanks
 
Odd, the way you describe it I'd expect the number of legs to be whatever you set it to.
 
4:20 PM
self.attr is generally unique to every instance
 
Assuming that you're doing Horse.legs = ... in the method and not self.legs = ... of course
 
Yeah, I was assuming the latter, which is why I linked the above.
 
but class shared data are shared by all the instances.
 
But if it is the former, I'm stumped.
 
We can't determine unless we see your code
 
4:23 PM
Ok one sec
 
@DSM my journal has to remain accurate.
Derrick Sebastian Montgomery.
 
Guys, do you know any library that can help you track an indirect recursion?
 
DSM
I'm still hoping for a dictionary which will tell me what indirect recursion is.
 
In the __init__ of Horse I have self.legs = 4
There I have method addLegs(self): self.legs = 5
Then in the other file I initialize a Horse and then I do NewHorse = Horse.addLegs
At last I try to print by doing NewHorse.legs but then I get AttributeError
 
I used to track it by going further to the last call, but when you have indirect recursion like the following f() that calls h() that calls g() that calls f()
 
DSM
4:29 PM
Is NewHorse = Horse.addLegs really your line of code?
 
NewHorse = Horse.addLegs()
 
There's many misleading things in your code
 
class Horse():
    def __del__(self):
        # do not beat
        ...
 
print(type(NewHorse)) may be instructive.
 
first don't capitalize the instance name, so we don't assume it to be a class
 
4:30 PM
Ok , I'm using other names, but I'll just take a pic of code
 
No.
Never take pictures of code and share those.
 
Pictures can't be copy-pasted into notepad :-P
 
Share text.
 
Ok
class Model:
'Class that represents our model that will be trained by giving'
'urls iteratively.'
streamIndex = 0
alpha = 0
started = False

# TODO: hyperparameters hier toevoegen
def __init__(self, alpha):
Model.streamIndex += 1
Model.alpha = alpha
self.test = 0

def testje(self):
self.test = 3
 
DSM
Thanks. Now I'm going to be humming "hyperparameters hier toevoegen" to myself all day.
 
4:32 PM
So why did you start talking about horses rather than your model?
 
Came first to my mind
import model

# initializing model
myModel = model.Model(0.2)

def test():
m2 = myModel.testje()
print(m2.test)
other file
 
But, why?
 
Are you a Python programmer?
 
Ehm, to keep my file structered
Would be to much
No
This si a project for school, first time python
 
We're not allergic to the term Model. In fact if we knew you were working with models we could give more targeted help, rather than assuming you were a completely new user who was interested in programming equine-based code.
 
4:34 PM
Ah ok , sorry for that
 
I can get behind the idea of simplifying the example so people don't get hung up on the minutae of the actual code, but if you take that approach you have to go whole-hog and write an MCVE that follows that same simplification.
 
they wanted you to quit horsing around
 
user559633
Maybe he was just horsin
 
user559633
dammit
 
DSM
Now, now, it's hard sometimes to know what makes something simpler and what introduces a new level of complexity.
 
4:34 PM
Agreed.
 
DSM
See, this is why we have to call it "Kevinning". Even other Kevins can do it!
 
@tristan we call that a horse tie, round these parts.
 
So you advice is to keep it all in one file?
*your
 
No, multiple files is fine.
 
these puns though
So how do I save the state then?
 
4:36 PM
Dude, don't be a neigh-sayer.
 
You're really trying to stirrup the laughs
 
Use @staticmethod and modify Horse.legs instead of self.legs.
 
We've these horse-based puns, I won't be here furlong.
 
Wait, I hadn't herd what he said
 
These are going to give me night mares.
 
4:38 PM
If you're hearing's that bad then perhaps you're pasture prime
 
@Stanko
class Horse:
    def __init__(self):
        self.legs = 4

    def add_legs(self, num):
        self.legs += num         # Or self.legs = legs\

    def print_leg(self):
        print(self.legs)


myhorse = Horse() # 4 legs
myhorse.add_legs(300) #alien horse with 300 legs
myhorse.print_leg()
 
user559633
colt blooded
 
this is one way to code your class
 
We're all taking puns from the same website, it's great.
 
I mare may not be getting this from a webiste
 
4:39 PM
#horse.py
class Horse:
    legs = 4
    @staticmethod
    def set_legs(amt):
        Horse.legs = amt

#b.py
from horse import Horse
def f():
    print Horse.legs

#main.py
from horse import Horse
from b import f
Horse.set_legs(23)
f()
Result: 23. Tadaa
Oops hang on There we go.
 
@Ffisegydd of HORSE we are
 
So I've been on vacation and came back to my code. Can't remember for the life of me what I did to fix my error:
Traceback (most recent call last):
  File "C:\Users\senarsky.CAL\Documents\2016Sem2\Sqlite-connect.py", line 223, in <module>
    modify_values()
  File "C:\Users\senarsky.CAL\Documents\2016Sem2\Sqlite-connect.py", line 170, in modify_values
    insert_values()
  File "C:\Users\senarsky.CAL\Documents\2016Sem2\Sqlite-connect.py", line 137, in insert_values
    dbmgr.query_params(query, user)
  File "C:\Users\senarsky.CAL\Documents\2016Sem2\Sqlite-connect.py", line 13, in query_params
    self.c.execute(arg, params)
 
When you pass in operation, you aren't passing in a string
 
I should stop writing code while listening to podcasts.
 
@direprobs @Kevin thanks for the help, it was very horseful!
 
4:41 PM
@Dominico909: so what is arg? It doesn't appear to be a string.
 
Grrr! arg.
 
Who's psyched for Warcraft?
 
Dunno, why?
 
query = "INSERT INTO " +edit+" "+values+" VALUES (?)", (user)
That's a tuple, not a string.
Drop the , (user) part.
 
DSM
"That line's got a case of the tuples" is what I would have said, if MP hadn't beaten me to it..
 
4:43 PM
But then how do I insert that value
 
Oh this wasn't that linked question from earlier was it?
(No. But similar.)
 
Oh got it
I messed up when looking up the documentation
nope
nvm
 
If you're looking at documentation then you're messing up in a much more minor way than most people :)
 
I really wish nosetest would show me WHICH element of my dictionary doesn't match. :/
 
Does it not?
 
4:48 PM
It doesn't help to say that two 50 element dictionaries don't match, nosetest!
 
py.test does IIRC.
Especially when you've only got 2 elements in your dicts.
 
DSM
Isn't davidism our "nose is dead, long live py.test" guy? Or is that Antti?
 
A few of us believe in the One True (py.test) Path.
 
@RobertGrant What do you mean?
 
Nope, and it turns out the issue was that the value coming from my function was a float converted to a string, but the test data I had was an int.
So the issue was '0.0' != '0'.
table flip.
 
DSM
4:49 PM
Bright side: interviews for positions with substantial dollar amounts attached. Downside: guy who wears plaid and jeans has to wear a suit.
 
Noooooooooo.
 
surely plaid denim suits exist
 
"First they came for the plaid, and I said nothing. Then they came for the jeans, and I said nothing. Finally they asked me to shave, and there was no one left to complain."
 
I just unwrapped a lozenge, threw it in the garbage, and put the wrapper in my mouth.
I'm done with today.
 
4:51 PM
I have no beard and I must scream
 
Well plaid, Bob.
4
 
DSM
@MorganThrapp: a few days ago I opened up a packet of oatmeal and emptied it into the garbage, instead of emptying it into my bowl and tossing the packaging into the garbage.
 
(I realise the pununciation is wrong for the states, and I don't even know what it is in the UK, but I went for it.)
 
DSM
It's okay. Around here we admire effort (cough llanfair cough).
 
It's ok, it's a visual rhyme. Make the medium work to your advantage.
 
4:55 PM
I'd say it's pronounced the same as "played"
Not "plah-d"
 
@MartijnPieters So how does removing that allow me to insert values
 
Let's compromise. I'll keep saying "plahd" but stop saying "wore chester shire sauce"
 
DSM
For me "plaid" rhymes with "sad", but not with "bag". :-P
 
Same.
 
@davidism Ctrl+P actually does seem to work in this version.
@DSM Yup, that's correct (for once).
 
4:58 PM
sad and bag rhyme for me, I think.
 
@MorganThrapp depends on the function, some work some don't
 
@davidism Huh, it works with something user defined, where I would've assumed if it were going to break, that's where it would break.
 
DSM
I once proposed that we should each write out a copy of the Zen which we could combine sentences from to compare handwriting. I wonder if we should record ourselves doing one of those "read these few dozen words" tables..
 
Can you give me some examples of functions that break?
The issue seems to mostly be overly aggressively selecting things other than the function. It seems to retain the last element you had your cursor on and try to apply the Ctrl+P to that.
 
I'd be up for either so you could mock my dulcet Northern tones.
 
5:00 PM
@DSM Ha, you don't want to compare my handwriting.
I make doctor's writing look legible.
 
I'd do handwriting but not a voice recording.
 
Heh
 
@MorganThrapp can't give you an example because now everything seems to be working
:-/ I'm sure as soon as we're not thinking about it it will stop again.
 
Of course.
Yeah, and I just proved my own theory wrong.
I have definitely had it fail multiple times today, but I don't know why.
 
cbg
 
5:06 PM
Cbg, idjaw.
 
Imma writing out Zen as we speak.
 
@Dominico909 I didn't look at your code in detail, I only traced why you got your error.
 
But then I can't insert values without that parameter
 
Did you notice I'm a moderator, by the way? Stop rolling back my edit please. — Martijn Pieters ♦ 27 mins ago
 
@Dominico909 the query string doesn't need the parameter, you pass in on to the method.
 
5:13 PM
 
@MattDMo That was after roll-back number 4 or 5..
I had to lock the post.
 
yeah, I saw the edit history. Nice smackdown :)
 
@MartijnPieters ah thank you
 
DSM
@Ffisegydd: neat! I'll do one later today, after the next round of submissions is done.
 
I have this code and I really want to track the recursion
 
5:19 PM
 
but I'm trying to find a library useful for that
 
Oops I couldn't fit the whole thing on one page.
 
Do you choose to not use cursive or was that what you were taught?
 
I know cursive but my speed is about the same either way, and longhand is more readable, so it wins.
 
I write urls in longhand but that's it.
It's more readable but slower.
 
5:25 PM
I can barely read cursive, and when I write it it looks like a second grader did, because that's the last time I used it.
 
I think we were forced to use cursive throughout school.
 
I stopped using it around a year before college.
 
My writing has always been bad, but as I never write nowadays it's gotten even worse.
I take written notes throughout the day, but mostly it's just scribbles that remind me of what I needed to remember.
 
I probably hand write something twice a year, so you really don't want to see my writing.
And I can't even begin to do cursive.
 
After I discovered that Mrs Crandall's proclamation "in every grade after this, your teachers will deduct points for not using cursive" was completely false
 
5:27 PM
I only write in cursive
 
What's the word for "not cursive writing"? I just think of it as writing, but I have no idea how to say "I didn't write in cursive I just used <x>".
 
I had to write in cursive to be able to write with a pen, rather than a pencil. It was like a badge of honour.
 
I say "longhand" even though most of the letters are taller than they are long.
> N. ordinary handwriting (as opposed to shorthand, typing, or printing).
Hmm, doesn't actually exclude cursive, does it...
 
print
 
I fear writing in cursive in exams and get zero....
 
5:29 PM
is what you would say to not be cursive
 
On some standardized tests, I recall that they required cursive for some parts.
I can't recall if it was for the entire essay portion, or just for the "sign your name here to agree that you aren't cheating" form
 
It's not about that, I'm quite skeptical that the person correcting my exam may misread a word and deduct a grade, this happens
 
Cheaters all be like "if it's in cursive, it's even more binding than regular!"
 
I have to make my hand-writing clear in exams, take into your consideration I'm not the only student, essentially teachers won't give a damn about unclear words, they'll mark it X and say bye bye!
 
Sensible.
 
DSM
5:34 PM
I once couldn't remember whether a word was masculine or feminine in French so I tried to split the difference in the way I wrote the word. My teacher was not fooled.
 
hahaha
lol
 
Sanity check, this dupe is ok, right? stackoverflow.com/questions/36987301/…
 
You wanted to play smart ha!
 
Whenever I get a new teacher that says we will get a zero if its unreadable I pray mmines good enoug
 
5:36 PM
Læ chaise
 
Just like one teacher, I had a Java exam and I wanted to remember if I should write System.out.println or system.out.println
I thought about it, it's either the s is lower or upper, why not make it in the middle?
 
The answer is "it is dumb to test people on programming without a full development environment available to them"
 
What's with all the hand-written copies of the Zen of Python? Did your teachers give you all extra work after school for being naughty?
 
DSM suggested it offhandedly.
Or rather, mentioned offhandedly that he suggested it offhandedly in the distant past.
 
39 mins ago, by DSM
I once proposed that we should each write out a copy of the Zen which we could combine sentences from to compare handwriting. I wonder if we should record ourselves doing one of those "read these few dozen words" tables..
 
5:39 PM
Alright, guess what? I'm going to write the Python Zen now
 
I notice Fizzy doesn't do capital letters in cursive. I can never remember how to do G, myself.
That's not one you can sort of fake by doing an especially large lowercase letter.
Nope, wouldn't have guessed that.
 
Yeah, I'm pretty sure that's not a letter.
 
I feel like I've seen it on a cereal box...
But Kellogg's starts with a K.
 
We were taught that capitals should be separate from the rest of the word in cursive.
 
 
5:46 PM
I also draw my x's like you draw the mathematical x (two cs, one of which is reversed).
That's from years of writing formulae.
ↄc
 
I don't think I've ever done that.
 
Helps to distinguish it from the "x" used in multiplication by some people.
 
DSM
Yeah, I sometimes do that too. Physics repRE-SENT!
 
I just use a dot for multiplication. Why yes, it does make it confusing when I need to do dot products later on.
 
I also use a dot for multiplication, most importantly I use a dot at the bottom of the line for multiplication and one in the middle for decimal points.
 
5:49 PM
If I have enough foresight, I'll use an asterisk.
 
3·0 . 5·5 = 16·5
 
My troll meter is twinging
Please cryogenically freeze me until a global standard exists for numerical notation
 
Not even trolling.
 
Grrr, I really want to expand that to 3*0.5*5=16*5.
 
I'll chalk it up to cross-continental cultural drift, then
 
5:53 PM
Which doesn't even start to make sense.
 
cabbage from the land of cabbage
@MattDMo I love how Martijn still writes "please" in there:D
not you, wait
much better
 
@Ffisegydd you're not serious, are you?
I haven't seen decimal notation like that since journals in the twenties or something
(I know, hand writing is a different matter)
 
Fizzy's carefully constructed facade that he isn't a 1920's mathematician begins to crumble
 
6:06 PM
*physicist ;)
 
Hey, Kevin, have you seen this before? dribbble.com/beesandbombs
 
@AndrasDeak Absolutely.
 
ok?:P
 
It works fine when you're used to it.
 
I usually don't seek out other giffers, so that I don't get inadequacy attacks.
 
6:09 PM
you're a giffer?
@Ffisegydd I guess. I just really haven't seen anything like this:)
 
Oh nooooo, that guy had my idea before I had it.
Case in point.
 
wildly hypnotizing
 
He's also got a tumblr, though I don't know if it's just the same content, or what.
 
Did someone say Tumblr? Are you trying to summon Tristan?
 
Nah, if I was, I would talk about xkcd's tumblr and how it's the height of nerd comedy. Just like Big Bang Theory.
And how I think everyone isn't nearly sensitive enough.
 
6:16 PM
"News story of a man in Boston who broke into the nearest house to use their internet. As police were taking him away he was heard screaming "BUT THEY NEED TO KNOW MY OPINION ON WHY THEY'RE WRONG!""
 
Local crow was heard talking about how he was writing a future script about java.
 
Man from Philadelphia confused by television - asks if they're like gifs that keep on going forever.
 
6:37 PM
Hi.
 
@Alex82 cabbage
 
I'm doing a Pygame game.
 
So far so good.
 
Aaaand it's a medium-2d one.
So, there's a z axis but you can't rotate the camera.
 
Tell me more, tell me more.
 
6:39 PM
That's all about it. I only have 42 lines of well-commented code.
 
Well, good for you.
 
Yeah :I
Well, the problem is...
 
OH SO THERE IS MORE.
 
yes.
 
:O
 
6:40 PM
gasp
 
stay tuned. Same Py-channel....Same Py-place....
 
The problem is that I don't know how to render all on layers.
I mean layers.
 
Use C++ to write games
worst programming language ever
 
nah i prefer python
 
It's an ugly language, let me be harsh here
 
6:42 PM
Well, so can anyone help meh?? ?
 
no
 
I have a little bit of pygame experience. Here's what I'd do: keep a collection (list, stack, whatever) called layers that contains a number of Surface objects. You render sprites to each of those surfaces, then blit them all together into a single master surface, which you blit to the screen.
 
I mean, maybe.
But you should share some code.
 
I can't.
I'm programming on a different comnputer.
 
I never used pygame though, I just use console to write games haha, you want to see games from the 60's we have 'em here LOL
 
6:44 PM
lol
@Kevin, tell me more.
 
Did it put up a fight?
 
?
 
I gtg, this nonsense is over 9000
Bye
 
6:47 PM
Actually, let me backpedal a bit here. Are you asking "how do I make sure my HUD always appears in front of ordinary game objects?" or are you asking "when I move around in my 2d platformer, how do I achieve a Parallax effect so that foreground objects move faster than background objects?"
 
the good old Fred Flintstone effect!
no wait, those cartoons are exactly missing the parallax
 
Ok, I haven't actually implemented parallax in like eight years.
The basic idea is that you take the x and y offsets of your main layer, then multiply by some factor (smaller than 1 for background layers, bigger than 1 for foreground layers) to determine the offset for the other layers.
Now trying to dig through my crusty archive of nine year old projects to try to find the program where I do exactly that...
Maybe if I search for "background.bmp"... How do I grep only filenames again...
I guess I don't have it.
 
7:17 PM
stackoverflow.com/q/36989633/2301450 no mcve and "Please consider this closed"
 
7:29 PM
Is there a shorter way to get groups of two from a string than [x+y for x,y in zip(s[::2],s[1::2])]?
I feel like there is and my brain is just failing.
Shorter in a golf sense, that is.
 
zip(*[iter(s)]*2)
 
DSM
Could do the old iter*2 trick:
>>> [x+y for x,y in zip(s[::2],s[1::2])]
[1, 5, 9, 13, 17]
>>> list(map(sum,zip(*[iter(s)]*2)))
[1, 5, 9, 13, 17]
 
Hmmm, I seem to be doing it wrong.
Ah ha, got it!
 
8:12 PM
'sup nerds
 
user559633
8:27 PM
uWSGI worker 2 screams: UAAAAAAH my master disconnected: i will kill myself!!!
 
so violent
 
user559633
oh uwsgi, you're pretty embarrassing. O_o
 
@tristan I had a message like this in my production machine. "My master kill-ed me! Somebody call the Police"
That went through formal review process, and I was asked to change it :'(
 
@tristan it gets better. Someone actually corrected the grammar: github.com/unbit/uwsgi/commit/…
 
user559633
@thefourtheye i think the closest comment i've left is: // sure, when i try to kill a child, someone gets in the way
 
8:29 PM
lol
 
user559633
@idjaw oh, well thank the lord for that
 
user559633
also, hi matthew, didn't mean to ignore you
 
How do people even come up with code like this
-2
Q: getting every possible substring in perl

Martha Elena IbarraI would like to generate every possible consecutive substring of a string, including the end of the word/beginning from the word (cyclic) letter combinations. I've found an example in Python, but the only language I know is perl (and barely, I'm a beginner). I would appreciate it a lot if someone...

it looks like black magic to me
 
@Natecat "should the translated version have the same errors in it?"
 
9:16 PM
cbg
 
grr, is gravatar.com down for others as well?
 
Do you guys now, if in Python 3.4+ there is a oneliner to run an awaitable till completion out of asyncio loop, possibly on a thread without asyncio loop at all?
 
Something like asyncio.wait_for? Just a guess from reading docs.
 
9:34 PM
@MartijnPieters it works for me now. Also, isitdownrightnow.com/gravatar.com.html
good night
 
9:54 PM
@AndrasDeak the top-level site responded with a redirect, then got stuck somewhere. So 'is it down' sites fail to notice that kind of unresponsiveness.
@AndrasDeak: sample curl test: curl "https://www.gravatar.com/avatar/24780fb6df85a943c7aea0402c843737?s=48&d=identic‌​on&r=PG", which now succeeds but failed when I asked.
 
10:05 PM
http://stackoverflow.com/q/36991811/344286
 
 
1 hour later…
wim
11:08 PM
Ooh. Just got the Django badge. What to track next??
 
Unchained badge
 
11:34 PM
Hello!
 
hello @bertrand
 
I am new on chat. How do you do that?
@TadhgMcDonald-Jensen Is it like this
 
thanks
:30298079
 
@bertrand you can only do it that way if there is a message to accompany it
 
11:37 PM
@TadhgMcDonald-Jensen ok?
like that>
@TadhgMcDonald-Jensen Thank you
Bye
 
Exactly!
well probably, I'm not seeing how you are actually doing it :)
 
Hey when you ask a question and it doesnt get any answers whats the process to like bump it back onto peoples radar?
 
@ZackTarr if it is one-two days old asking people in chat to have a look is fine
 
Yeah I posted it yesterday night so I was hoping to get some eyes on it. I think I have to implement a thread to make it work but am unsure of how to do so. I may very well be wrong tho. Its stackoverflow.com/q/36963353/6275676
 
sorry, have never worked with pyqt4 so I have nothing for you, wish you luck though!
 
11:48 PM
Thanks tho! Just didnt want to post it on here and get yelled at for doing so. There is just no error and I can find where its getting stuck!
 
01:00 - 16:0016:00 - 00:00

« first day (2025 days earlier)      last day (2922 days later) »