« first day (1718 days earlier)      last day (3245 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!
 

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