« first day (2361 days earlier)      last day (2812 days later) » 
00:00 - 16:0016:00 - 00:00

user6900888
00:20
@AndrasDeak i have posted that question with full information take a look please.
Basically my neural network is producing midi files but they are small enough and also i got all the data for adding two midi files but having that issue.
see my latest question please
user6900888
6
Q: Extract data from list with some conditions

BaapBasically i am trying to adding two midi files and there is not much information on internet about it so i am trying my own. what i did so far is i have added two midi's messages (type of midi's data) and i have list of both midi messages , It means i have all the data which i need to merge two ...

04:03
def check_for_hit(cords, board):
    x = input("Row: ")
    row = int(x)
    y = input("Col:")
    col = int(y)
    guess = (row, col)

    if board[row][col] == "H" or board[row][col] == "X":
        print("You've already guessed that one, try again.")
        print_board(gameboard_p1)
        check_for_hit(cords, board) # This line is giving me trouble


    marked_hit = False

    for guesses in cords:
        if guess == guesses:
            marked_hit = True
        if marked_hit:
            print("hit!")
Trying to get the user to be able to reenter there coords but the line I have commented returns some weird results, what am I doing wrong?
 
2 hours later…
06:50
hangover cbg
 
2 hours later…
08:47
cabbage
cabbage
09:37
recbg
09:49
Cabbage
@Baap Please don't ask in here for help with your fresh SO questions, or link them. See the room rules for details.
@Tokencodingnewbie Your check_for_hit function returns None, so what do you mean by "the line I have commented returns some weird results". Please be more specific! But anyway, you shouldn't use recursion to re-ask for input, use a while loop. Also, the second part of that function is a bit strange. If guess matches an item in cords you set marked_hit to True so all subsequent items in cords will be reported as "hit!". Why don't you just do
if guess in cords:
    print("hit!")
    board[row][col] = "H"
else:
    print("miss!")
    board[row][col] = "x"
@PM2Ring Yeah I put it in a while loop, I didn't know how to explain it other than weird results it was giving me numbers I didn't even enter.
@Tokencodingnewbie Have you seen Kevin's Asking the user for input until they give a valid response ?
no ill look at it
@Tokencodingnewbie You should know the drill by now. We need a MCVE so we can reproduce the problem.
Yeah, sorry I've been away for a bit and forgot.
10:05
cbg
@IljaEverilä OP hasn't verified
right now it looks more like no MCVE, doesn't it?
I voted no MCVE
The exception in the title is a result of a typo. SQLA Base does not have meta dada, it does have metadata.
The 2nd exception in the question body is indeed no mcve
Cabbage
What Ilja said. I don't know SQLA, but here are the relevant docs: docs.sqlalchemy.org/en/latest/orm/extensions/declarative/…
11:09
13333 rep \o/
I should stay here
or gather 20k more to make it even odd
I just saw this question when it was proposed as a dupe target for this. What should we close it as?
first retag it with python-2.x?
@AndrasDeak And remove the generic tag? I'm not comfortable with that. However, the behaviour alleged by the OP doesn't occur in any version of Python.
I meant add it, generic should always stay
Maybe re-tag it as [tag:python-i.x] since it's from some imaginary version of Python. ;)
11:15
but at least there should be some hint that u'' can only appear in py2 output
@AndrasDeak ok
at least that's my 2 cents, step 0 ;)
OTOH, removing the generic tag might make it harder to find... I guess it won't be easy to delete, with such a high score.
I've just added the 2.x tag
I guess we could close it as No Repro. Or maybe No MCVE
find a dupe, or no repro perhaps (I'll think about it later)
then we can delvote
Soooo
Who missed me?!
or noticed I was gone, validate me D:
11:22
@AndrasDeak OK. I found a good target. stackoverflow.com/questions/19170808/…
So I just used it to hammer both of those questions. :)
11:34
awesome
2 more days and I can delvote :P
You use global if you want to change a class variable right?
no
don't use globals
class attributes can be modified by every instance, that's sort of the point
game_won = False;

def check_for_win(cords):
    if len(cords) == 0:
        game_won = True
It says that I'm over shadowing the name from outer scope.
11:50
@AndrasDeak ThE top answerer hasn't been active since May 2015, but the OP was last seen a minute ago. Maybe we can encourage him to self-delete... Since the question's so old, he won't lose the rep for the question, will he?
@PM2Ring they wouldn't, but they can't delete with an accepted answer
@Tokencodingnewbie What does that have to do with your question about class variables?
@AndrasDeak Ah, of course.
Can they un-accept an old answer?
Maybe I phrased it wrong.
@PM2Ring they can... but I'd be reluctant to do so if it was me
user6845426
cbg :)
11:52
you can still try though
@Tokencodingnewbie yes
cbg
@AndrasDeak Fair enough. Although the answerer probably won't care, since he's no longer active.
yup
and usually rep on upvoted posts is stuck after 60 days, but sometimes accepts behave differently...
so, whatever :P
either way we can get rid of it
@Tokencodingnewbie Is that your IDE saying that? The Python interpreter wouldn't care that you're creating a local name that matches a name in the global scope.
I wanted to change the one in the global scope but yes the IDE is saying that
are you not inside a class then?
user6845426
11:55
Writing my thesis is destroying me.
You know, I don't think it is inside of a class. Now I'm confused because in other languages dont' you need a class with a main function?
"Other languages", aka Java?
And the ilk.
lol yes Java
I was just working with Java
Friend wanted me to make a minecraft plugin but it was too above my knowledge to make :/
I got kinda bummed and didn't code for a week plus got a new house.
if the line of code is inside a class Foo: block, then it's inside a class :|
it doesn't get any simpler than that
12:02
not_in_a_class = ...

class Foo:

    i_am_in_a_class = True
@PM2Ring well there were a few upvotes in the last 60 days, but I don't think that matters much
same for the anwer
@Tokencodingnewbie The check_for_win function creates a local game_won, it doesn't affect the global game_won.
@Tokencodingnewbie if you insist on using globals then yes, you need global <varname> before you can assign to it
also: "coordinate" has two o's in it
I know ><
I kept it in there because I though it made the code quirky...I dunno it's just a codeacademy drill I've taken beyond the max of the scope.
12:06
I think cord is an acceptable name. As long as you don't find yourself wondering "Did I name that thing cord or coord?"
it gives me the same kind of twitch as "vacum" does
I prefer to use the older form with dieresis, "coördinate", when I'm writing by hand, but I rarely bother on the keyboard, and I don't like using non-ASCII variable names in code.
is this still april fools? :P
@AndrasDeak Oh dear. All those poor newbies, thinking they're learning something valuable because it's on SO and has lots of upvotes...
def check_for_win(cords, win):
    if len(cords) == 0:
        win = True
ok so i tried passing it in
and it now it says the local variable win is not used
12:16
are you sure it says it's not used?
is it not an error about calling the function with insufficient number of arguments?
@Tokencodingnewbie That's not going to help.
ah, right
It compiles and runs fine, could it just be an IDE error?
no, PM's right
again you're rebinding the local name win
cue PM's link to why names are not variables
Mar 21 at 8:27, by PM 2Ring
@Drizzy In the mean time, here are a couple of articles that explain a very important difference between Python and most other languages. Other languages have "variables", Python has "names", and Facts and myths about Python names and values, which was written by SO veteran Ned Batchelder.
but even passing is in as a parameter it doesn't change the variable?
12:19
no
def test(a):
    a = 42

a = 1
test(a)
print(a)
#output
1
@Tokencodingnewbie read the two links before we continue -------------------------------------------^
Yeah I'm going to
Might take me a minute, they put me on some sleeping meds and I'm all hazy
it'll take more, no rush
take your time to understand it, it's a conceptual thing
Alright cool thanks.
12:20
@Tokencodingnewbie The first one's pretty short, and has some cute diagrams.
if you don't understand that, then we'll keep coming back to this all the time
lol thanks guys
You're so much nicer than those Java people.
just don't drink and drive take drugs and program ;)
Well my friend swears smoking pot helps him, but I don't see how.
12:22
it might depend on the quantity
Yeah and the person, sometimes it helps to visualize things though.
but most of the time it just makes me stare at the IDE like "huh?"
but sleeping meds don't sound at all like "programming guru unlocked"
No
I've been sleeping for like 3 days
I got an appointment tomorrow
and I wouldn't know anyway, I've never actually taken any drugs
Ah well I blame my parents they handed me down a bunch of anxiety and insomnia lol
stupid genes.
12:24
that's life for you;)
I try and make it work for me, but it gets tough.
Anywho I better get to reading and cleaning before my gf clubs me over the head.
good luck, take care
13:02
Bug report from user: "this page times out when I submit a .xlsx document containing more than 200 rows of data". It's up to me to replicate this bug. Currently trying to decide whether it would be less painful to get the data from the user, or write a script to randomly generate a 201 row report.
Historically, getting files from the user has been difficult, since increasingly draconian security protocols mean that flash drives and email attachments regularly fail to work
I wonder how many columns are in that file
Let's see, A through O, so... fifteen?
openpyxl is fairly easy
I can leave the "remarks" column blank though so more like 14
what if the bug is in there?
13:06
That seems... Unlikely.
then you have my approval for only generating 14 columns
I vote for developing a markov chain based on the existing remarks
A third option I have is to handwrite one row, and copy-paste it 200 times. But it's possible that one of the columns has a uniqueness requirement so the page might "helpfully" condense it all into one row, or just crash.
"You know how you could determine if such a requirement exists?", think the other conversants. "By trying it and seeing what happens"
Yes, yes, but then I couldn't put off working by talking about working.
DSM
DSM
Morning cabbage.
cbg
@Kevin are most of those numbers? Because you can drag an =random() or whatever it's called
and perhaps convert the results to numbers to make sure it's authentic
13:15
Most of the column headers don't indicate what "type" the cells should be, save for two columns indicating "MM/DD/YR". Hmm, I think I just detected a Y3K bug right there...
DSM
DSM
Last week I was discussing with people my growing sense that no function should be committed which reads from a data source without a corresponding mock tool which produces equivalent test data.
I don't have any arguments against that
That sounds very appealing to me.
DSM
DSM
This has been an issue lately as one of the applications at NumberFirm requires access to expensive proprietary data connections not everyone has (myself included), and so testing bulk transformations of the code is a major problem.
Sometimes we'll get page timeouts in production and the DB team will say "this is probably because Table XYZ has ten million rows" and I'll look at my local database and it will have a thousand rows and so I can't objectively benchmark potential solutions
13:23
\o cbg :D
"the change I implemented runs faster on my machine, but maybe I accidentally increased complexity from O(N log(N)) to O(N^2) and the speed improvement only works for small tables because of a better constant multiplier"
Then in production the average execution time goes from three minutes to a hundred million years
morning everyone
does Flask + PostgresSQL make sense for a webapp which is only for managing "mocked" data? i.e., a very thin API that doesn't do much except read/write from a DB
@corvid yes
morning mr. cyrillic name
13:34
Miss, call me Nata.
What in your opinion makes code a high quality code?
pieces which are modularized and configurable
if code == "high quality code":
     print("This is a high quality code")
DSM
DSM
Have I mentioned how useful I find the unidecode module? Handy when you have a bit of Cyrillic you want transliterated.
(Belyakova Anastasia)
corvid, could you explain more detailed ?
Actually it is Byelyakova Anastasiya as in my passport
13:37
it's always a gamble with Russian transliteration:)
@DSM transliterated, TIL that's what was my assignment called in university....
one of my pet peeves is that ё becomes e
I recently met an "Alena" at a conference and I guessed that it was more like Al(y)ona
It's better than my transliteration strategy of picking whichever ASCII character most closely resembles each source letter. Backwards R and R are pronounced the same, right? ;-)
Yes, closer to latter, Alyona. Would be closer to actual pronunciation
13:41
All I can read in cyrillic is "pancake cat"
DSM
DSM
As for code: simplicity of data flow matters a lot for me. Related to, but not quite the same as, cyclomatic complexity.
DSM
DSM
.. is that Nicolas Cage?
as an amateurish programmer my view of code quality is "the fewer I say WTF, the higher the quality"
13:44
My rubric for code quality is, in its entirety, "I know it when I see it"
Readability, functional, reasonable resource usage, is all I care about.
I have an easier time describing what isn't good code, going by the various multiparagraph rants I've given in here over the years
usually the problems I find in professional code are a poor separation of concerns which becomes unextensible
Since I work in interfaces, the absolute most common thing I find is that people mix together logic like data-fetching, sorting, filtering, and the view logic, such as how it is rendered
That is a point to remember, corvid.
One more question.
I have in Django a view that changes a web page. How can I make this changes visible to other user?
13:59
That is awesome, Kevin! Thank you!
It's an old classic
it does not makes it worth in any way
@БеляковаАнастасия question is too broad please provide us with more details or a [MCVE]
DSM
DSM
I've often thought similar things about Kevin.
Welp, turns out the report reader I'm working on does have row uniqueness requirements. Here's hoping it properly interprets "=C4 +1" as "one plus the value of the cell above this" rather than "a string containing an equals sign, a capital C, [...]"
google -> MCVE
@Kevin you can "copy content" or something from formula-populated cells
I was trying to develop a simple chat. One user logs in and posts a message on webpage, how to make messages available to other logged in user
that's what I meant by that
Turns out it can read excel formulas OK, so converting to literal values didn't turn out to be an issue
14:20
@AndrasDeak Gorbachev who?!
exactly
DSM
DSM
@Kevin: does this mean you can now confirm and fix the actual problem or are you still in the setup stage?
My expectations: Kevin's MCVE won't reproduce the problem, and an endless fight for the actual input ensues
Now I'm getting ORA-00001: unique constraint (SCHEMA_NAME.TABLE_NAME_PK) violated ORA-06512 so I guess it's still not unique enough
the server feels so violated
DSM
DSM
14:26
InsufficientEntropyException
What does pycharm mean with "zero latency typing"?
your fingers are too fast
Presumably when you type, there is little to no observable latency.
Isn't that always the case already?
I have no idea, I never noticed any latency before.
14:29
It's a bolded new feature, so apparently something amazing
are we really ignoring the ambiguity of the word "typing"?
quack quack :D
what if using type hints used to take too long? :P
When I have a lot of windows open, the keys I type in Visual Studio will lag behind by half a second or so. Why yes, it is annoying, thanks for asking
Seems to be indeed about type hints or something
14:31
"Whoops, I made a mistake".
[holds backspace key down until typo vanishes, then releases backspace]
[VS continues to backspace for an additional three seconds, wiping out five lines of functioning code]
That moment when SO's spoiler creator creates too long of a link to paste the link in this chat :(
Oh well pastebin works too I guess : D
@MooingRawr try spoiling more things, but in smaller chunks.
here, apparently the zero is not that zero in quite a many competing editors
Zeroer? Which one is zeroest?
14:34
@AndrasDeak meaning, the latency used to be zero for quite large values of zero...
DSM
DSM
Is 0+0j in C more zeroy than 0 in R?
in C?
what's a j?:P
So after reading that guide I think I got it, kind of.
def check_for_win(cords):
    if len(cords) == 0:
        return True
    else:
        return False
@DSM yes.
@davidism was typing up that ghost in the shell movie for you, ended up doing it in pastebin Ghost in the Shell thoughts, contains some minor spoilers
14:36
i'm actually almost done with this program, might be the first one I've seen through to the end.
@Tokencodingnewbie that looks fine, assuming that you're calling that function as you should and you're handling the return value
Hot tip: rather than doing if condition: return True \n else: return False, just do return condition
provided that condition evaluates to a boolean (and it does in your particular circumstance), then the behavior is identical
I don't know if it's a bad thing or a good thing, if I don't remember much of the movie after seeing it on the weekend.... :\ Or maybe my love of the anime's version is just over writing the new movie.
@Tokencodingnewbie return not cords that is
14:37
OK, guys, chill, the point of the above is that he's no longer rebinding a local name instead of changing a global one
And because lists evaluated in a boolean context are truthy or not based on whether they're empty, you can just do return not cords and... Oops, beaten by Antti
@Tokencodingnewbie what you have above is fine, what the others are suggesting is just an improvement in style and number of characters and idiomatic programming
Oh what did I do wrong?
@Kevin Finally. A bright new star shines on the starboard side. Kevin Kevin'd by Antti.</wishful-thinking>
14:38
that's what I'm saying: nothing :)
I'm open to criticism I just don't get what they are talking about
@AnttiHaapala wish upon a falling Antti
I'm... Not sure how else to explain it
if len(coords) == 0:
    return True
else:
    return False
###
return len(coords)==0
###
return not coords
the above 3 are equivalent if your coords is a list
or... rather they're equivalent for most things that len() accepts.
14:40
oh i got it what I did was redundant
the second one is easy to see, the third one needs the additional info that bool(lst) is truthy for a non-empty list, and it's falsey for an empty list
the 2 first are always equivalent.
I remember learning this with c++
In [17]: not [1,2,3]
Out[17]: False

In [18]: not []
Out[18]: True
return not coords?
How can it not be coords?
DSM
DSM
14:42
Heh.
read what I'm telling you
@Tokencodingnewbie not x coerces the x into a boolean truth value, then inverts that value.
and for lists, their boolean truth value is True if the length is non-zero, False if the length is zero.
and if you're still drowsy, consider revisiting the problem when you're more awake:)
Haha, you totally did. Laughing Man is the show, not the movie.
14:46
right.... :D
but yeah overall it's a no brainer watch movie. if you want that go see it... no thinking needed. Typical Hollywood I guess :\
As long as people who haven't seen the original like it (and it's not a completely different movie), I think it accomplished what it need to. It would be hard to be as good as the original.
@AndrasDeak because at work we have something called GOTS and I gots mixed up.
gotscha
Mooing is just confused though. :-)
14:50
Was very confused while interpreting those spoilers as pertaining to Game Of Thrones
DSM
DSM
I liked the tone and style of the original Ghost more than the plot, which I didn't find that interesting. To be honest, it reminded me of a college film student who'd seen an episode or two of the Outer Limits.
@davidism from what I heard when leaving the theater, there wasn't too much of a complaint, mostly 'that was interesting', 'pretty', 'what do you wanna eat'. I will say a lot of the little details were left out which I was quite said, they nailed the important famous scenes but it's the little remarks and little interactions that I was looking for :\
Game Of Thrones: Suzuka
The way I heard it described, Kusanagi asks philosophical questions in both movies, but in the new one, she asks the wrong questions and the whole message changes.
Haven't seen it yet, but I'll go see it soon if I can.
DSM
DSM
A violent fantasy story taking place in the exciting world of high school track.
14:52
@DSM Never saw the 'Outer Limits', Ghost in the shell, was my first taste of an 'adult themed' sci fi anime movie, (I don't think you can count Gundam series to be that). So it hooked me really quick, as it was opening my eyes to some problems I didn't think/knew about, prior
like tearing your own arms off while trying to open a tank
@davidism oh I can see that kinda... I felt like the movie was just like, 'this is the way this is, and this is bad, for this reason right?' but that was just me... I could be wrong
@AndrasDeak spoilers (or not) man :D
DSM
DSM
I'll probably catch it this weekend and see what I think. For all I know, I might -prefer- the new movie's take.
considering that literally the only thing I know about the movie is that it's starring Scarlett Johansson, spoiling a 22-year-old anime might be fine
go watch it and let me know what you guys think.
14:54
You can't really spoil the movie, the story is very minimal.
It's not trying to be groundbreaking or have a clever twist, it's just there to present the themes.
what theme is a spider tank suppose to betray? Throughout history, tanks were very scary, also spiders are scary too, so lets combine them into a super scary thing :D
as long as Scarlett doesn't pinch-zoom directed mobile call data streams, I'm fine
It's true, don't look for a deeper meaning. So what that the future-tank shoots out the tree of life.
Fair enough....
DSM
DSM
After shooting out some fossils, or fossil images, if memory serves.
14:59
Why was that even in that random warehouse?
"Because that's where the tank was, and otherwise it couldn't have shot it."
DSM
DSM
#synchronicity
I think the only good live action adaptation I actually enjoyed was Rurouni Kenshin... maybe it's because the original one wasn't that deep of a plot
15:33
@AndrasDeak cough
re-cbg
Looks like I opened up a can of worms with my quip about necromancer:
Some people aren't comfortable with the term "Necromancer". Perhaps that badge could be renamed to Post-mortem communicator :) — PM 2Ring 2 days ago
@ZeroPiraeus :P
Nier: Automata Any% Ending A one handed in 1h54m: twitch.tv/videos/133126315
@PM2Ring Damned PC liberals forcing me to promote their wicked post-lifestyles.
some people pretend to be very very dense in that comment thread
15:45
I managed to score an upvote on a relatively large PCG answer, but I wasn't going for small size. There was already a small Pythonic answer, so I decided to write one that could handle large inputs because the OP said "Extra kudos to the one who can come up with a solution which doesn't produce all permutations and then search for the input. That's some challenge."
and by some people I mean Jeremy P
@davidism =O what diff was it ?
Normal
@AndrasDeak I appreciate where he's coming from, but the reality is that there are good programmers who are from strongly religious communities, and SO isn't the place for debates about religion.
I'm loving the fan comics/manga coming out for Nier. Some are adorable and wholesome. I want to see it speed run at AGDQ :D
15:48
I'm imagining an actual necromancer objecting to the term, explaining for the hundredth time that "there's no romance involved, my interaction with skeletons is strictly professional"
@PM2Ring and his stance on the badge is fine, but Ed is rightfully scolding him for being offensive about others' religious beliefs in geleral
@AndrasDeak "but but x did the same thing as I did, why aren't you commenting about his behavior " or something along those lines :D
@AndrasDeak Yep
and it's like "Ed: don't be an ass. Jeremy: but the badge name is not a problem, people are stupid. Ed: but don't be an ass."
@MooingRawr Yeah, that's just juvenile.
15:50
it's like a C-grade sitcom
@MooingRawr and he didn't
the comments have been decimated
comments aren't the place for discussion :D I wonder if they moved to a chat room to continue
you'd see a link then
I wonder if he invited him to a chat room, and then removed that link too
but good point
I.... don't.... know actually.. nevermind.
15:55
it was a pointless stream of bickering, I'm fairly sure it just got nuked
I already had it, but chicken baked in cream and cheese :P
I'm trying to figure out what I should buy for lunch :( it's the hardest decision for my work days :\
00:00 - 16:0016:00 - 00:00

« first day (2361 days earlier)      last day (2812 days later) »