« first day (3319 days earlier)      last day (1634 days later) » 

2:55 AM
 
3:13 AM
see markdown source of the answer I wrote these for, for the code to generate these graphs - stats.stackexchange.com/posts/427611/revisions (it's long and hacky to get the text aligned just right so I don't present the code in the actual answer)
 
4:01 AM
If I left anything important out of my graph let me know... I did label the axes, and I think the edges are all labelled as well... - I don't need to label the vertices do I?
I don't think I will...
 
4:17 AM
oh, yes, I wanted the right angle indication... but I suppose that isn't necessary at this point given the grid. If anyone knows how to draw that part though, let me know and I may add it...
 
 
3 hours later…
7:31 AM
Can i just say that looks super cool!
 
 
1 hour later…
8:59 AM
@AaronHall I was thinking something like ax.plot([1.9, 1.9, 2], [0, 0.1, 0.1], [0, 0, 0]) when I suggested pyplot
Don't know how that plays with patches
 
9:27 AM
@ParitoshSingh huh, I didn't realise you can't just use render_template_string outside of an app. I suppose that makes sense but it didn't occur to me that it required the app context, I thought it just invoked Jinja for template rendering and the app context part was handled by the route. I'm learning more than expected from this :)
Now I'm not so sure on the best way to do the timings properly. I don't wanna drag in all of the Flask machinery just to see how long it takes Jinja to create the table
 
9:43 AM
Is that a technical concern or just reluctance to bother with it?
 
A technical concern because I don't think I'll be able to run it through %timeit properly. I'm looking into Jinja2 itself atm but it looks like Flask does its own stuff before passing the template to Jinja so I'm not sure exactly what is pertinent here
 
Well if you want to time render_template_string then time that. If you want to time jinja write a function with jinja. And either way you should write a tight function to time. If you can do that interactively use %timeit, if you can't: use timeit.timeit
 
But render_template_string looks to not work without an actual app running to pass a context
 
So set up an app and time with timeit.timeit?
 
That's the bit I have to work out. I need to build an app context and not launch the app
 
9:52 AM
Why not launch it?
 
Or actually, you might be on to something with timeit.timeit. I guess I could have that as part of the actual route
 
that ^
Have some part of the app do the timing
Just take care that timeit.timeit is dumb, you need good params
(You can replicate %timeit by doing an exploratory timing run using which you can estimate params)
 
Yeah, I recall from a question on main that it has a default of 1m loops. I can do without that :P
 
shortMonth='November'
if shortMonth=='January':
     shortMonth=1
elif shortMonth=='Feburary':
     shortMonth=2
elif shortMonth=='March':
     shortMonth=3
elif shortMonth=='April':
     shortMonth=4
elif shortMonth=='May':
     shortMonth=5
elif shortMonth=='June':
     shortMonth=6
elif shortMonth=='July':
     shortMonth=7
elif shortMonth=='August':
     shortMonth=8
elif shortMonth=='September':
     shortMonth=9
elif shortMonth=='October':
     shortMonth=10
elif shortMonth=='November':
     shortMonth==11
why doesn't this print 11?
 
Separately, you want to look into dictionaries
Also, that code isn't going to print anything because you didn't use print(). Assignment is "silent" in the sense that it's not going to be visible to you by default
 
9:59 AM
@Abhinav == is not assignment
elif shortMonth=='November':
     shortMonth==11  #!!!
 
Oh, yeah, and there's ^ right at the end
 
Use a list or a dict instead of that error-prone wall of code
 
ok
 
Side note: these are long month names, not short
 
10:13 AM
> ValueError: I/O operation on closed file
Why the heck is that a ValueError? >_>
 
So that you can bring it up as a conversation starter.
cbg!
 
cbg
 
@roganjosh interesting. I guess i always assumed it without ever explicitly thinking about it, but it's good to know regardless.
 
That's what I'm running into :) It's too easy to make assumptions here, so it's "fun" to actually work through it
 
@Aran-Fey because it's not a TypeError. Think of "value" meaning" state in this case.
 
10:21 AM
Why not IOError though?
 
because there was no IO
 
"IO" meaning "communication with the OS"?
 
it did not even attempt to do IO, it just straight up says "you are allowed to do that on file types, but this one has value 'closed', so shoo".
@Aran-Fey I'd define it as "communicate outside the process", but yes, that usually means the OS
 
makes sense if you put it that way I guess
still, things like this is why I resort to using except Exception: way too often...
 
@roganjosh do you have the jinja template prepared already by any chance? The one with jinja side looping for table values. I might take a stab at this too
 
10:28 AM
@ParitoshSingh It's starting to look like an endless task here because I used app.jinja_env.globals.update(get_depts=get_department_list) in the past and now I don't know how that plays with Flask
Sure, 1 sec
 
oh. im thinking of ditching flask entirely
Im assuming for our purposes, it should be fair to just use jinja directly
 
this is the code I've been working with. It's semi-broken, I was in the phase of creating an actual app
 
perfect, ty
 
 
2 hours later…
12:11 PM
I'm making a simplified Google Quickdraw in Keras. Currently, the CNN is giving me the following error:

Traceback (most recent call last):
File "C:/Users/grizl/OneDrive/Desktop/FTN/SK/projekat/SimpleGoogleQuickdraw/models/vanilla_cnn.py", line 124, in <module>
create_model(x_tr, y_tr, x_val, y_val, x_tst, y_tst)
File "C:/Users/grizl/OneDrive/Desktop/FTN/SK/projekat/SimpleGoogleQuickdraw/models/vanilla_cnn.py", line 47, in create_model
validation_data=(x_validation, y_validation))
File "C:\Users\grizl\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\engine\training.py", line 1
I failed to edit the message in time - apologies for the poor formatting.
 
12:55 PM
Mmm, having my own statements repeated back at me in bold, in addition to quotes, is fast becoming my new pet hate
 
[...] is fast becoming my new pet hate - is that so @roganjosh? /me starts running away...!
 
<grabs the newspaper>
 
I love newspapers... the feel and sound while I rip them apart... thanks mate! :)
 
Now you know the buttons to push to get your newspapers. We'll hand-wave the delivery method :P
 
lol
What can I say - I'm a pro... unlike this guy - just a complete amateur... should only take a few seconds...
I could do that yellow pages under the shelf faster than that
 
1:01 PM
I think he took issue with all the fake news
 
there's no such thing as fake news... there's just alternate truth... get with it? :p
 
My apologies. I think he took issue with the alternative truth
Is this a good time to say that I'm about to put in an order for male fragrances? Would anyone care to see the list?
 
recbg
 
In fact... I don't think that guy was even amateur level... maybe a semi-enthusiastic hobbyist... all those slippers and shoes, and he didn't take advantage of the moment to use it as an excuse to get a little bit of slipper shredding in :(
@roganjosh Sure... anything off creedfragrances.co.uk ?
 
Errr, the let me consult the manual a bit more, I'm not sure how I'm supposed to deal with questions over the brand
 
1:07 PM
As long as you've got an old can of Lynx Java somewhere on the list :p
 
@roganjosh Re our earlier discussion, I wrote this, but before i could share it earlier i had to step away. But i THINK i didn't make any mistakes, and this can be used for comparison. The results might be surprising though. link
 
I wonder if that's actually still a thing... I know Lynx is still a thing, but I don't recall seeing Java for gosh knows how long
 
This pyramid scheme has everything, you just need to give me time :P
 
Lynx Africa is still a thing - that's quite an old one
 
@ParitoshSingh no way. Thanks for sharing that, we must be missing something here?
 
1:10 PM
@roganjosh holy yam! On the plus side - they do offer free delivery ebay.co.uk/itm/253944762778 :p
 
I have yet to run it with bigger numbers, but yeah, it's not what i expected at all.
I guess this now makes me question how does jinja fill a template in? Is it also essentially doing the same thing under the wraps?
 
This was the problem I was having; it seemed I opened a bit of a rabbit hole. At the same time, I can verify the outcome of your timings
 
@ParitoshSingh wow... that "by_hand" immediately made me think of PHP :)
 
hehe, whoops :)
 
Out of curiosity - what is it you're trying to discover with that experiment?
 
1:16 PM
@ParitoshSingh I know nothing about Jinja, but I'd expect it to be faster than Python if it's not using immutable strings. So your results are a little surprising.
 
Honestly PM, i don't know what jinja is built on either
 
@JonClements we were discussing it yesterday. He posted some "gross" code where they concatentated strings together and I then questioned whether Jinja was actually faster
 
@JonClements was just a question we accidentally stumbled upon, Wanted to test our assumption that constructing an html element by hand is slower vs letting jinja handle it.
 
It made me realise that I've taken a lot for granted in template rendering, and we're now seeing the fruits of questioning "the obvious"
 
I'd expect native Python to be faster since it's not got the overhead of building parse trees and then template tag/function lookups
 
1:18 PM
oh jinja is built in python too
 
I know :)
 
I didnt :D
 
Sure, but your code was a loop of string concats so it had a chance to win (I think)
 
I think the "by hand" method can be sped up a bit, as I said yesterday, by using listcomps & .join. Also, try building each row separately and join rows together, rather than just concating everything to the destination string.
 
Still think it's an apple/pear comparison
 
1:19 PM
Agreed. I just wanted a barebones comparison first
 
@JonClements how so?
 
my feeling is that you'd have to write some pretty damn inefficient Python code to have jinja trump it
 
@ParitoshSingh Ah, ok. That explains it.
 
@JonClements See, the thing i honestly assumed so far was: doing incremental string buildups is the inefficient python code we were looking at.
 
@JonClements it's here
 
1:21 PM
as I said... jinja has to parse the template, build a syntax/parse tree, then when it wants to do basic operations, it's got another level of indirection to do so, as well as things like what to do when handling missing context and whatever extensions may or may not be called depending on etc...
 
If it helps, i DID try to throw the "string by hand" output via jinja
Just so we can get as close to a fair comparison as possible. Both versions send data to a template and render it
 
I'm impressed with the effort, thanks for continuing my test case mate
 
Sure, not at all. I was equally curious too. Sadly, i have now attempted to run it with 50000 samples. I do not recommend it :P
 
I think just a glance at jinja.palletsprojects.com/en/2.10.x/api - kind of explains what's happening and all the different considerations that jinja is doing that native python code building up strings isn't...
 
@ParitoshSingh let's not and say we did? :P
 
1:25 PM
Ooh, it spat out an answer, finally
Ok, much better. This makes sense to me
nvm
It was what i wanted to see. i made a mistake
no, i didnt. what? Sorry, im rambling.
%timeit by_jinja(table_headers, table_body)
406 ms ± 17.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
%timeit by_hand(table_headers, table_body)
1min 32s ± 2.42 s per loop (mean ± std. dev. of 7 runs, 1 loop each)
With 5000 rows:
%timeit by_hand(table_headers, table_body)
%timeit by_jinja(table_headers, table_body)
832 ms ± 29.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
39.1 ms ± 950 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
 
make sure you're not making jinja hit any cache in the second one
 
oh. hmm
I assume it shouldn't considering i construct the template and render inside the function call
 
I also don't know what it would be caching
 
once it's compiled a template - it doesn't reparse it to produce the code again
so for each use of the template you save a step (similar to how python will use precompiled bytecode vs parsing and compiling .py files if not necessary)
 
So timeit is loading from a cache?
 
1:34 PM
What can i do to time this properly?
 
1:45 PM
From the code gist.github.com/ParitoshSingh07/… I can't see how the template could be cached. It should die when the function returns.
 
I don't know the answer to that, but I don't suspect caching. The runtime still increases with sample size and I'm not sure what would be cached here
 
In the real application, will template caching be useful? I.e., will the app need to frequently regenerate the same table but with different data?
 
ive updated the code sample. this should answer every question really
by_hand: 0.827967643737793s
by_hand_semi_optimized: 0.82792067527771s
by_hand_optimized: 0.015595436096191406s
by_jinja: 0.04691052436828613s
5000 rows. first run, so no cache involved
also, i ran it afterwards, the runtime for jinja doesnt change much
link for the code.
I suspect jinja would be doing something essentially like the optimized version, delaying string concatenation till the last possible moment
 
Jinja also does fancy stuff, like accessing attributes on a SQLA result, or call iteritems() on a df, as I learned a few days back
Still, playing around with this has thrown a lot of my blind spots into light
 
@PM2Ring quite a few web frameworks support caching mostly to avoid having to rebuild the result from something like a db query if it knows (or based on a certain time frame) it can use the cached version...
 
1:58 PM
Jinja isn't a web framework, though. Part of the problem with my tests was including Flask, but Paritosh has just gone straight to Jinja2
 
that's not something I'd expect a template engine to by default take on itself though... but not surprised if there's options to make it do so
 
Aye, best i can tell, in this example there's no cache involved. Or if there was, any cache was destroyed when the function exited. Repeated calls to the same function are giving me same/similar times
 
@JonClements Ok, but I was talking about the specific app that uses Paritosh's table-building code.
 
okie dokies :)
arghgh... much further away from a pandas silver badge than I thought I was... doesn't look like that's happening this year then... sigh
 
@PM2Ring nah not really in my case. its maybe a use-once-a-day thing
 
2:12 PM
@ParitoshSingh Maybe change those time.time calls to use time.perf_counter, but it probably won't make much difference on your system. Or get really serious & use a Timer from the timeit module. ;)
@ParitoshSingh Rightio
 
I can't answer for Paritosh but, at least for me, it was an issue to rally around and actually understand what it is that I'm calling every day
 
Oh i didn't know about time.perf_counter, interesting
And aye, I enjoy exploring little things like that. Especially If i have an expectation or assumption about things, It's good to make sure our assumptions aren't outright incorrect.
 
Here's an example of how I generally use timeit to time functions, in case you're interested. stackoverflow.com/a/46569726/4014959
 
2:29 PM
Oh that's nifty, ty
 
Python 3.8.0 (default, Nov 17 2019, 14:20:43)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Sweet - time to have a play :)
 
>>> if foo := True:
...   print(foo)
u gotta
just to make sure it's working
 
>>> if foo := True:
...     print(foo)
...
cbg!
looks like I've got a quirky version - but I can live with it :p
 
3:02 PM
@roganjosh don't think I've asked already, but are you on Steam at all?
 
I'm not, no? Are you asking for your ass to be kicked in an old game? :P
 
lmao
I'd challenge you to some Duke 3D but alas, it's no longer got the copy I have
 
Worms! :D
 
Worms taught me all the trig I ever needed to know
 
omg... I got and gifted a couple of copies of Worms Armageddon when tristan was about... we played once/twice... we were both awful
(it was very much not a game of who did the coolest stuff killing the worms on the opponents team, more just who least mucked up and ended up killing their own worms first :p)
Anyway - just mention it 'cos I've still got two copies of Trine 2: Complete Story just sitting there
 
3:11 PM
Hmm. I don't know the game. I really wanted to play my best mate at Dungeon Keeper 2 but he doesn't know the first thing about computers so it was awkward to try set up
 
never tried the 2nd one... I know I loved the first one though
 
ooh ooh, we're talking games?! :o
 
But I think it's still possible, it just takes some faffing to get the server going
 
oh wow, dungeon keeper 2 has really old graphics :P
 
Still one of the best games ever
 
3:15 PM
they were awesome at the time - sheesh!
and was novel and so much fun to play
 
The AI is way before its time
It will mercilessly go at you... for a game from 1996 (IIRC)
 
Doom was awesome... and didn't require 30gb+ of disk like some modern FPS's :p
I think Quake's open source now isn't it?
think a mate bought me a copy of that as an xmas prezzie years ago
 
Lots of games are
 
which was quite funny, since I'd bought him exactly the same :)
 
Some require dosbox or they've just been completely rewritten
 
3:20 PM
oh haha, that would have been amusing to open the gifts
I just sat through and watched the first mission gameplay of dungeon keeper 2. I still have no idea what i just witnessed, but i think the guy won :P
i think the first game i really remember playing was road rash
 
@roganjosh open transport tycoon \o/
 
Dungeon Keeper 2 is definitely worth the effort
@AndrasDeak huh, they pushed the franchise that far? I enjoyed Hotel Tycoon
 
@AndrasDeak I'd be up for a game of that... I'm rubbish at it though
(always seem to end up with buses that go nowhere because I'd forgotten to lay one yamming road tile!)
and the UI is err... a little weird to get back into
 
oh i used to play roller coaster tycoon
I didn't find out about too many games as a kid though, fairly limited exposure in that sense
 
What about Theme Hospital?
 
3:27 PM
I use to enjoy some of the "Theme..." ones - like Hospital and Park
ugh, got Kevin'd
lasticsearch | {"type": "server", "timestamp": "2019-11-17T15:26:42,367Z", "level": "ERROR", "component": "o.e.x.s.a.e.NativeUsersStore", "cluster.name": "docker-cluster", "node.name": "7567f647bad0", "message": "security index is unavailable. short circuiting retrieval of user [matthew]", "cluster.uuid": "F62RwiIMQd6DzwtDwtXwWQ", "node.id": "L7ANjf3uTeurLjeuZP1j1Q" }
 
Boom! It's foreshadowing for your match against me in a game of your choosing :P
 
umm... might have to sort that ^^^ out first... two ticks
 
@roganjosh on sale at GOG
 
If I set up a DK2 server later, is anyone interested in playing?
 
Umm... yeah... is there a copy available to run under Linux?
eg: would I have to buy a version, or is it OS that I'd need to either compile or run under WINE or something?
 
3:35 PM
I think dosbox works on Linux. I seem to remember Andras putting me down here :P
 
ahh... got dosbox... just don't have DK2
 
Oct 22 at 22:00, by Andras Deak
yeah, it's called dosbox
 
If you don't mind having to teach me the ropes, i'd be down :P
 
if it's not "free"... I'm sure there might be an ISO image out there somewhere... coughs
 
It is shareware stuff now. Give me a few mins to see how best to do this
 
3:42 PM
@JonClements just checked, not abandonware :( gog.com/game/dungeon_keeper_2
On sale though
 
It's not, and I've just gone through a few links here. If you don't buy it, you might just have to find a .iso hanging about, like dropped in a carpark or other
 
Are there any chatrooms on stackoverflow/in general that are better suited for ML/Pytorch questions? I just don't want to keep bombarding this chat haha
 
who knows - government ministers leave CDs full of national insurance numbers and personal details (non-encrypted) on trains occasionally... although, I feel it less likely someone's dropped a working CD of DK2 in my nearest car park
 
@ROODAY some people tried creating a ML room, I suspect that didn't take off. Maybe there are rooms on chat.stackexchange.com, I don't know
 
@AndrasDeak Thanks, I'll look around there!
 
3:50 PM
This stuff happens, though. And nobody can fault you if you happen to then install it, @JonClements
 
anyway, a good way to freeze a system is forgetting you're testing locally, and not using a docker compose file that says to elastic it can have 64gb of ram... and then have system rules that limit processes... anyway... it seems happy with 4gb now
mind you the client has gone for a ionos.co.uk/… - soooooo overkill for right now
I suggested a $40 DO droplet to get started but oh no...
mind you... can't wait to get started playing with that beast
Love the bit that says Just £320/month (excl. VAT)... at least it's 30 day refundable or something... they're just really jumping the gun... it's annoying when people don't listen... sighs
wonder if I could sneak a minecraft server on it :p
 
*Dungeon Keeper
 
4:05 PM
TIL monkeyuser.com, very dev-related webcomics
 
4:17 PM
Oh, i guess i should take a walk in my nearby car park
 
:P
 
I..uh..forgot my keys there
 
4:40 PM
"it's good to be bad.." it's almost as if they knew.
 
Woohoo, you've got it installed?
 
Is everyone playing a game?
 
I suggested that we might play Dungeon Keeper 2. Obviously there is no compulsion to play
 
Is it free and does it run on linux?
 
4:45 PM
no, yes maybe?
 
I defer on that.
 
someone said something about dosbox
or was that something else?
 
Oh maybe there is proton.... But i'm on my portable computer so I would probably wait before buying.
 
It's from 1995/96 :)
 
but it's old and cheap
 
4:46 PM
@AndrasDeak My frugality toward games knows no bounds.
 
(I'm not playing, but I'm vaguely familiar with it)
 
apparently 1999
 
Oh my. Time flies :P
 
I need to find a good reference on distributed file systems so I can stop being less bad at HPC lol.
 
As a user or as a service provider?
 
4:48 PM
@ParitoshSingh I'll have to play around for the server itself. In the meantime, you can practice :)
 
yes sir :P
 
User of HPC.
 
What makes you "bad at HPC" as a user?
 
high performance computing?
 
yup
 
4:50 PM
gotcha
 
@AndrasDeak I've mismanged the use of distributed file systems in the past. In particular I've based my work on old papers that don't seem to take into account distributed file systems. For example: aaai.org/Papers/AAAI/1999/AAAI99-103.pdf
My algorithms have turned out to be inefficient because I don't understand what additional communication costs are going on "under the hood"
 
OK, if your work is the HPC cluster then I understand. To me it's just the underlying infrastructure, not the target nor tool of my work.
 
It looks like I may have to do another distributed project in the future that may not be able to store everything in RAM and I would like to know how to take this into account correctly by understanding better how the underlying mechanisms of the filesystem.
@AndrasDeak That's what I did too :P
 
5:06 PM
@ParitoshSingh Hamachi is not happy. It might take me some time to spoof a local network :/
 
all good
 
From what I remember there's quite a bit of a learning curve anyway
 
@AndrasDeak Voted to close although I suspect that OP wants piecewise linear interpolation
 
Probably...
@roganjosh virtual LAN, nice
 
It's the only way I think it can be done :/ We're going back to the dark ages here :)
 
5:16 PM
You mean glorious golden age
 
Yes, that, sorry :P
 
When nobody threatened your mom during multiplayer because you were all at your parents' place
 
 
1 hour later…
6:27 PM
wow... was looking for some stuff... didn't realise that Richard Kiel was 7'2"... youtube.com/watch?v=666ZjLucACg
knew he was massive in James Bond but wow
 
 
2 hours later…
8:48 PM
stackoverflow.com/questions/58902130/… may I request this be reopened
 
9:15 PM
@variable while the dupes seem not to answer your question, the question may well be closed again for other reasons. You are explicitly asking two separate questions. Some paragraphs are really hard to read ("My question is that ..."). The malformed code snippets don't help either.
So I recommend cleaning up your question further to have it well-prepared if it gets reopened.
 
9:40 PM
@variable What MisterMiyagi said. You need to fix the indentation of your code snippets. Use backticks around inline code terms like __init__. Try to improve the wording so that it's easier to read and less confusing. For example, don't use abbreviations like "foll.". Also, your question should have the tag.
@variable BTW, davidism is the Flask maintainer, so he generally knows what he's talking about regarding Flask. ;) If his dupe links don't help you, you need to clearly explain why not, either in your question or in a comment.
 
 
1 hour later…
11:11 PM
I have a global list variable which multiple threads append to and then die, is there a way to implement this without having to use a global variable?
 
yes, pass the list to the threads
Thread(target=some_func, args=(your_list,))
 
I need to use this list afterwards though.
in the main thread
 
I fail to see how that's a problem
 
Would the threads append to a copy of that list? Should they lock something before appending to the list? Should the lists be returned and then concatenated?
 
No, the threads receive the list
you append to it and you're done
 
11:17 PM
what if 2 threads append to it at the same time?
 
it'll be random which value is appended first
 
so I just read that lists are threadsafe
that's pretty cool
 
11:56 PM
@holdenweb Just saw your August conversation v late. Yes, but often that's itself a symptom of people turnover, and haphazard hiring. And once it starts, it's hard to stop - good people wont want to work on a bad codebase (spaghetti, multiple users, no tests, tons of known issues but bug reporting is ignored, always have a more urgent business need, "no time to fix/refactor")
 

« first day (3319 days earlier)      last day (1634 days later) »