« first day (1718 days earlier)      last day (3224 days later) » 

8:03 PM
@JoranBeasley django orm, lol. lol lol lol. Sorry but it is the part why I had to switch away from django, with all the others one can live with, but not with the orm.
it would be trivial to provide the django style filters on top of sqlalchemy orm though
 
yeah, there's even a post by zzzeek about it somewhere
 
8:20 PM
So there is a website called watchpeoplecode where you can watch people program like watching people play videogames on twitch. I might have to check that out
 
You missed me on livecoding.tv earlier.
 
I'm kinda curious about how much of the time is actually spend typing out code. Vs Googling and tabbed chatting
 
@Dracunos Personally? About 10/90.
 
That would be me on a good day
 
My ratio goes up considerably after hours.
 
8:27 PM
I did spend a lot of time trying to figure out what ANSI ASC X12 standards are, and why they're $2500.
 
I think I spend the most time just figuring out what the 'ell the users actually want
aside from magic
 
Is the answer ever NOT magic?
 
None of these streaming sites are working on my mobile :(
There we go, twitch works. I'm watching someone new working on codecademy
 
yes. Sometimes they want me to stand on my head to cast the spells
 
It's pretty painful to watch. And he's listening to bad music
 
8:36 PM
why would you want to watch someone code?
 
DSM
If someone were explaining things as he went along I could see how it might be helpful to learn a new pattern.
 
Well, maybe someone out there somewhere actually does code like they show on tv and just click clacks away really quickly and efficiently, like tv hackers
 
DSM
Huh. I was thinking exactly the opposite -- they'd have to be coding slowly enough so I could follow their thoughts.
 
I'd probably prefer just a prerecorded class for something like that
 
@DSM that's true but then I just need to see their screen :)
as long as they wear clothes
 
8:41 PM
Who the hell wears clothes while coding? Hah
 
user559633
"yeah so this is a list comprehension of lambdas that uses the visitor pattern"
 
We should force tristan to do all his coding on a live stream full of heckling viewers. Open mic
 
hmm...I wonder if watching someone code would provide for better knowledge retention due to the increased visual stimulation (cues)
 
8:58 PM
@davidism OP wants to spawn a multiprocessing pool within a Flask app. I said that’s a bad idea and likely to break, and something like celery should be used instead. Is that the correct advice?
 
Yeah, you should spawn it from a different controlling process, whether that be celery or your own code.
 
user559633
@Dracunos lol that would be amazing. I'm not even kidding, I'd have such a good time with that
 
@tristan "I've seen better factory methods in an actual factory!" "Your singletons are so big, you should call them doubletons!".
 
user559633
@MorganThrapp i actually laughed
 
@davidism Flask/WSGI things are spawned themselves in threads usually anyway, right?
 
9:03 PM
Scoping? 360 no scope!
 
user559633
i'm not the best coder, but i'm okay, constantly learning, and want to get better, so it would be amusing to have some crazy hyperbole going while i'm coding
 
@tristan "What is that? A list comprehension? More like a list incomprehension"
 
user559633
@poke uWSGI is configurable to start multiple processes and can be set to spawn a number of threads. When you connect Flask to uWSGI, uWSGI does all the concurrency handling
 
@poke yeah there's no guarantee on how many times the app/factory is imported/run in wsgi threads/processes. Easier to just run the background stuff separately.
 
@tristan Yeah, I know about uWSGI, but I’m wondering what the “default” is for such apps
 
9:05 PM
anyone goin to watch the leap second? :D
 
And the reloader during development could complicate it even more.
 
Okay, got it, thanks :)
 
user559633
@poke Oh, sorry. I didn't see that it was a response to an earlier comment until after I hit enter
 
@tristan :)
 
@AnttiHaapala Oh yeah, that's tonight, right?
 
9:05 PM
@AnttiHaapala When exactly is it going to happen?
 
user559633
8pm EDT
 
000000000000000000000000000000000000000000000000000000 utc
 
nice
 
or 23.59.60 UTC :D
 
9:06 PM
so in 3 hours?
 
yea
dunno where to see it bc my linux does not obey leap seconds :(
 
Won’t be still awake then. I’ll celebrate it tomorrow by turning my clock forward by one second.
 
user559633
@poke LOL
 
That’s a long answer
Btw. you can remove the first part where you localize string.replace and string.translate because as the Python source code shows, it just delegates to the str methods replace and translate which is what OP was using to begin with :P
 
user559633
9:17 PM
@poke Yeah, I did that as a stream of consciousness as I learned what it was actually doing.
 
user559633
I mention later in the post that the above was a lie, but I didn't want to take it out because it would make the inspect.getsourcefile useless, which I wanted to keep in because it seemed like the user was learning how to profile/debug python
 
@tristan hem, you'd want to remove your dis code :D
>>> dis.dis("\0\6\6\6")
          0 STOP_CODE
          1 <6>
          2 <6>
          3 <6>
dis.dis if given a bytes, thinks it is bytecode
 
user559633
where do you see that?
 
in your answer
dis("'1 a 2'.replace(' ', '')")
dis(x=None)
Disassemble classes, methods, functions, or code.
if given a string, it does the last one
>>> def foo():
...     '1 a  2'.translate(None, ' ')
...
>>> dis.dis(foo)
  2           0 LOAD_CONST               1 ('1 a  2')
              3 LOAD_ATTR                0 (translate)
              6 LOAD_CONST               0 (None)
              9 LOAD_CONST               2 (' ')
             12 CALL_FUNCTION            2
             15 POP_TOP
             16 LOAD_CONST               0 (None)
             19 RETURN_VALUE
 
user559633
Oh, thank you.
 
user559633
9:27 PM
I figured that was the case, but tested it with a different string and didn't get that behavior -- or rather saw different output.
 
all in all, these happen in C, and you'd want to see them... but
they're pretty hard to read
 
user559633
cheers @AnttiHaapala
 
damn my wife woke up bc of your bell :D
forgot to mute computer
:D bed chat
 
That question btw, did you try running it on a string that isn't trivially short?
 
user559633
@QuestionC No, ran out of lunch hour
 
user559633
9:30 PM
from dis import dis
def dis_replace():
    '1 a  2'.replace(' ', '')

dis(dis_replace)

 3           0 LOAD_CONST               1 ('1 a  2')
          3 LOAD_ATTR                0 (replace)
          6 LOAD_CONST               2 (' ')
          9 LOAD_CONST               3 ('')
         12 CALL_FUNCTION            2
         15 POP_TOP
         16 LOAD_CONST               0 (None)
         19 RETURN_VALUE
 
in any case, translate in python 3 is veeeeeeeeeeeeeeeeeeeeeeeeeeeeeery slow
 
user559633
looks better, yes?
 
and translate on unicode
 
@tristan wow nice job on that answer .... im curious as to total time that took to fully solve like that ? rather than my somewhat hand-wavy answer
 
yes it is better, but again the disassembly does not show any clue as to why which one is fast and which is not
@tristan noo
you're calling the func, and disassembling the string
 
user559633
9:31 PM
@JoranBeasley well seeing as i did a terrible muck up job
 
I just skimmed it but it looked really solid :P
 
user559633
that better now?
 
user559633
@JoranBeasley haha i only went into the question because your answer encouraged me to put in effort
 
oh so my answer is just totally wrong then?
bah humbug :P
(@AnttiHaapala )
 
user559633
What, no, your answer is better I think
 
9:34 PM
There's too much good churr in hurr. Despite the humbug
 
the case with .translate is that
it does not work similarly with str and unicode!
so if you pass in unicode string it will break
 
meh theres no unicode there is only cp1252
 
I was asked if I wanted to do C#/WPF
I said "Hell no".
 
user559633
Answer fixed. Thanks @AnttiHaapala @poke for making it better.
 
Any time
 
9:44 PM
any time = 23:59:60
 
user559633
that's coool
 
I lost my 1ml syringe :( now I have to use a 5
 
9:59 PM
overdose :D
 
DSM
5 times the juice (or insulin, or heroin, whatever.) Be careful!
 
user559633
no good story ever starts with moderation
 
I have to inject .5ml of air into each infusion pump module line to make sure it complains and doesn't allow people to get bubbly veins
 
hehe sounds fun:D
 
Running suites of unittests is the new "It's compiling!"
 
10:08 PM
The bubbles keep breaking up and it doesn't alarm. Take note, if you want to murder someone with an embolism, tap the iv line and make the bubbles break up into smaller bubbles
Or simply inject the air downstream of the iv pump. But that would be too easy
 
hi guys, a quick question, i have two arrrays, I appended an array to another a.append(b)

now i want to do something like "if a.append(b) do something" basically i want to do something if they are appended and if not i want to do something else

i tried if a in b, didnt work
is there a quick way to determine if a is actually appended to b
 
DSM
Aside: did you really mean to do a.append(b)? That adds the b array as the last element of a.
 
no i meant otherwise sorry, anyway i tried both ways
 
Nobody has given a sufficient answer to this question of mine: stackoverflow.com/questions/30961846/…
WHY?
 
@TanMath you could open a bounty...
 
10:17 PM
@AaronHall what about remote copying/uploading? (now known as "Internet is down")
 
DSM
@Fischer: but a.append(b) will always succeed, so it's not clear what the condition is.
 
user559633
@TanMath Make an attempt or add the code that you've written so far.
 
@Fischer What if I don't want to?
@tristan But if I don't know what to do, what attempt can I even make?
 
@TanMath edit the question to include a clearer case model/use case/question (if you edit it it will show back up on active posts)
 
@JGreenwell really? I have tried to do so for other posts but that didn't happen...
 
user559633
10:20 PM
@TanMath "I was thinking of doing polynomial regression in scikit-learn using their LinearRegression model." make an attempt
 
Can anybody here answer my question anyway?
 
user559633
That's not the way this room works.
 
@tristan sure, but what will be my input for this function.. I don't know how to format my matrix to input it into the function..
 
user559633
If you put more effort into your post, perhaps with your best effort at solving it yourself, I'm sure someone will come by an answer it for you.
 
@DSM if it always succeeds then I have a problem basically i am trying to remove duplicates before writing to file

for i in range of x
if row not in row2
append
then write to file
elif row in row2,
do nothing

thats the basic logic but not working
 
10:21 PM
@tristan In fact, I am not sure whether this function can take such an input
 
@TanMath I think your asking for a matrix where each element of the matrix is a matrix itself? Its hard to understand that question. Also, yes editing a question puts it back in the active question queue
 
@JGreenwell No, I have some matrices, which are really the output of this matrix function.. I want to find this matrix function by regressing each matrix element I want to directly input the matrix but I am not sure if that will work
 
@DSM so for each value of i, im checking if an array is contained in another array, if true, pass, else, make a copy of it in array2 and write to a file
 
DSM
@Fischer: even in the code you've sketched out there, you don't need or do an if some-condition-involving-append. And using row for a row and row2 for a list of rows is just going to confuse things.
 
what like a hat matrix?
 
10:29 PM
@DSM is my comment confusing too?

if row_dup not in(row):
row_dup.append(row)
writecsv.write(str(row) + '\n')
cant indent in chat
 
DSM
Your variable names look backward to me. Don't you want if row not in row_dup:?
(And it's better to use a set than a list for membership testing, but that can wait.)
 
@JGreenwell i guess.. except the predicted and response values are in square matrices (7x7)
 
@DSM thanks i didnt notice, changed all the code except that :) blind me
 
DSM
You might also be interested in the csv module. If row is a list, str(row) is going to have brackets on the outside.
 
@DSM true, im using the csv module, the output is like this [5, 7, 12, 1, 2]
 
DSM
10:35 PM
@Fischer: it doesn't look like you're using the csv module. write is not a method of csv.writer objects.
 
hmm...put the math (or mathematical concepts; like I'm trying to implement a multiple regression matrix, 7x7, that... ) in your question it might help others understand what your asking: there are a lot of people on SO way better at this then me and it will interest them
 
@DSM im using it for reading, not writing, i'll use it now, was just testing stuff
 
your current images are very generic and could apply to a number of models
 
DSM
Time to flee. Rhubarb for all!
 
actually, in this case might be better putting a use case as this may be an X/Y problem
rbrb @DSM
 
@JGreenwell I gave an example alreadt..
@JGreenwell so if it does, I don't mind if people use those other models
 
@JGreenwell and what is an X/Y problem?
 
@davidism thanks.. I saw meta was down too but it is back up
@JGreenwell I edited it.. is it better and clearer?
Also, quick question, is there a python-matlab interface?
also is there a python-wolfram interface?
 
11:01 PM
Cabbages, peaches and pears
 
nvm, I found how to do so...
 
Any of you guys getting a pyboard?
 
11:36 PM
anyone see a reason for why 'fCellList' is appended with a single 'myfile' rather than all the files in 'files' in this??
for fIndex, myfile in enumerate(files):
    f = open(fileDir + '\\' + myfile)
    fRows = f.readlines()[6:]
    for fRow in fRows:
        fRow_split = fRow.split(' ')
        for num in fRow_split:
            if num != '-9999.000': #and num != '-9999.000\n':
                CellList.append(num)
            for n in CellList:
                if n == '-9999.000\n':
                    CellList.remove(n)
    fCellList.append(CellList)
 
11:51 PM
@AF2k15 Hmmm
@AF2k15 Please format your code with PEP 8 - at least make your variable names lowercase instead of camelCase
 

« first day (1718 days earlier)      last day (3224 days later) »