« first day (3235 days earlier)      last day (1731 days later) » 
00:00 - 16:0016:00 - 23:00

12:21 AM
ok, trying to subclass an abstract Callable and use functools.update_wrapper on it - and getting noise like '__doc__' is read-only - suggestions?
trying __getattribute__ and friends now...
 
12:36 AM
trying to use __getattribute__ to delegate to the wrapped function object with names in functools.WRAPPER_ASSIGNMENTS....
 
12:48 AM
and that seems to work fine, so false alarm... :P
 
cbg
 
 
1 hour later…
1:52 AM
FYI - ping me if you want to talk.
 
2:44 AM
@Dodge I don't think so. FWIW, Guido does have an account: stackoverflow.com/users/818274/guido-van-rossum
@aadibajpai For your song lyrics program, you might find my time delay code here useful. Although that code is for much shorter, constant delays, it may give you some useful ideas.
 
3:01 AM
@Kevin This Gist plots orbits using Tkinter. It uses synchronized Leapfrog integration, but it only does simple 2 body calculations. It illustrates that the period of a (2 body) orbit through a given point only depends on the speed of the body, not its direction.
Highly eccentric orbits tend to accumulate errors faster than circular orbits do. The setup in that program is a handy way to judge how small your time step needs to be for a given maximum eccentricity.
Leapfrog integration is nice for gravity work because it's symplectic, that is, it conserves energy. Well, to be honest it conserves a thing that's extremely close to the actual energy. :) Leapfrog is also liked because it's reversible.
The Wikipedia article on Leapfrog Integration has a section ar the end about Yoshida coefficients. Yoshida's technique can give you much better long-term accuracy than vanilla Leapfrog. There's a rambling explanation / discussion at artcompsci.org/kali/vol/two_body_problem_2/ch07.html#rdocsect46
Despite the messy algebra in Wiki's brief description of Yoshida coefficients, they are pretty easy to implement in Python. I have a Yoshida version of the above program on my HD, but I haven't put it on Github. I was thinking of expanding it to handle higher order coefficients, maybe using recursion to calculate those coefficients...
 
3:26 AM
cabbage
Cool info re orbit calc @PM2Ring, thanks
Yes, the symplectic leapfrog method is what I suggested @kevin to use yesterday.
 
@ReblochonMasque I've just been catching up with the transcripts, so I saw your post about Leapfrog.
FWIW, there's a great Q&A on Physics about how the mass of falling bodies does affect the falling time, although the effect is insignificant unless the falling body's mass is comparable to that of the body it's falling towards. Don't heavier objects actually fall faster because they exert their own gravity?
 
3:50 AM
The bodies in your sim actually don't interfere with each other it seems - in fact it runs several sims of the same body, using various initial conditions.
 
Sun Sep 9490 06:55:16 EEST 1993
 
@ReblochonMasque Correct. "but it only does simple 2 body calculations". It would get messy when all the planets meet up, otherwise. :)
The main point of that program is to show that the orbital period (in a 2 body system) only depends on the kinetic & potential energies of the body. So it effectively does a bunch of 2 body sims in the same window.
 
 
1 hour later…
5:16 AM
cbg
@AaronHall Ping you, wut
 
 
2 hours later…
7:39 AM
I hope I will soon be banned from SO.
 
@AnttiHaapala Why?
 
Can we have a voluntary lockout :D
 
Ask a mod to suspend you? :D
 
so... there is a C question asking: "There is this code rand() % 100 for generating small random numbers, how do I generate a random boolean", then I close it as a duplicate of a question that says "I am using rand() % 2 to generate random boolean but it doesn't seem random, with long runs all the time, what should I use instead"
and then a commenter starts complaining that it is an incorrect duplicate, and I should close it as a duplicate that has an answer that says use rand() % 2
curiously even Commodore 64 Basic got this more right :D
 
@U10-Forward that comment sounded a little desperate and isn't really appropriate... I've removed it...
 
7:58 AM
23
Q: Is it reasonable to suggest that people asking questions should debug their programs?

David HeffernanAt this question Find, copy & paste specific parts of text from TMemo to other controls (like TEdit) based on some conditions I suggested in a comment that the asker should debug their program which was not behaving as expected. This comment was removed. It is my experience from answering many...

interesting :D
 
8:24 AM
re-cabbage
refrain - from - visiting - meta.........
The schadenfreude attraction is real!
 
user10984358
If I want to print the common characters in two names, is this the only efficient approach (minus the reduce and map)
 
user10984358
>>> stringOne
'Bella'
>>> stringTwo
'Acapella'
>>> temp=reduce(Counter.__and__,map(Counter,[stringOne,stringTwo]))
>>> temp
Counter({'l': 2, 'e': 1, 'a': 1})
>>> "".join(word*count for word,count in temp.items())
'ella'
>>>
 
user10984358
set intersection will not give me the two 'l''s (lowercase L) in this case, it will only give me one l
 
can't think of a better way to do it
 
user10984358
8:33 AM
order doesn't matter
 
user10984358
 "".join(word*count for word,count in temp.items())
 
user10984358
is there an alternative to this??
 
user10984358
or is that the only way you can join words in a counter?
 
@AnttiHaapala It did? Several PRNGs of that era were notoriously poor. I can't remember much about C64 Basic, but it was common for Basic PRNG functions to return a float in [0, 1).
 
@PM2Ring customarily to throw dice in C64 one would do int(rnd() * 6) + 1 which magically dodges the issue with low-order bits
 
8:36 AM
@TheNamesAlc Counter is practically a multi-set; if that's what you need, use Counter
 
user10984358
what I am speculating about is in combining the words to form the resultant string, is there any built in method or something that can do the word*count for word, count in temp.items() ?
 
not unless you consider things like mapping * over items as builtin
 
user10984358
I don't quite get you
 
are you looking for a faster or shorter solution?
 
user10984358
shorter perhaps
 
8:39 AM
@AnttiHaapala Yeah. I cringe when I see people using rand () % n, unless n is a divisor of RAND_MAX + 1, which generally means n is a power of 2.
 
@MisterMiyagi there is elements() for counter
 
user10984358
I would like to know both though, I want to justify at the end why I didn't go with the other
 
user10984358
isn't elements the same as keys()?
 
of course not
>>> ''.join(Counter({'l': 2, 'e': 1, 'a': 1}).elements())
'llea'
 
user10984358
other than the dict keys and itertools chain object?
 
8:42 AM
of course if you just need to print, you can use...
>>> print(*Counter({'l': 2, 'e': 1, 'a': 1}).elements(), sep='')
llea
 
user10984358
so elements gives me all the elements
 
user10984358
like ALL
 
that's what the docs say
 
user10984358
I dont want to print it though, I just need those to check some other stuff
 
user10984358
so elements it is
 
user10984358
8:43 AM
thanks!
 
@AnttiHaapala and it's not even a recent addition. learned something new that I should have known already ^^
 
user10984358
works peachy
 
but... your and/reduce might be off? I didn't check it :P
 
user10984358
it works
 
user10984358
it did for the example
 
user10984358
8:45 AM
I have to convert to lowercase though
 
user10984358
for the A and a to get caught as well
 
user10984358
I hope it does tbh
 
ah you do not need the reduce, it is the & that works for intersection
 
user10984358
actually I have more than two strings to deal with
 
user10984358
if it is two I can just and to Counter object can't I?
 
8:46 AM
>>> s1 = 'Bella'
>>> s2 = 'Acapella'
>>> s1 = s1.lower()
>>> s2 = s2.lower()
>>> common = Counter(s1) & Counter(s2)
>>> ''.join(common.elements())
'ella'
 
user10984358
I have to strip them off of spaces as well
 
yes. But with intersection you can ever only hold one Counter() and the one for intersection and and with the previous intersection
 
user10984358
so I just '&=' inside a for loop?
 
ya, initialize the intersection with the set of the first string.
 
user10984358
I guess that could do better
 
8:49 AM
Well, if you like you can use reduce+map but it is not always the most readable.
 
user10984358
I kinda use that just cuz I learnt how to use that if I am being honest, though I know people here prefer list comp or gen. expressions
 
user10984358
if I have like a gazillion strings and I want them to remove spaces in each and convert to lower case, would a map with a partial work or is there a better way?
 
well, every time I see __dunder__ methods being called, that's usually a sign of code smell :D
 
user10984358
I could always use operator._and
 
user10984358
too lazy to import :p
 
8:51 AM
yes you could :P
another thing with Counter.__and__ is that it doesn't work if LHS is in fact not a counter.
 
user10984358
I assumed for a long path using dunder made your code look cooler
 
well, you might know python but you've not yet internalized the Zen
 
user10984358
is that so? I never bothered checking that, I just wanted a quick solution and since I mapped them I didnt even bother checking the operands
 
try import this :P
 
user10984358
lol I read those, but I have to get my hang on it
 
8:53 AM
> Less well known is that the source code for import this is decidedly, and by design, unpythonic! Take a look at it for an example of what not to do.
72
A: What does pythonic mean?

JamesExploiting the features of the Python language to produce code that is clear, concise and maintainable. Pythonic means code that doesn't just get the syntax right but that follows the conventions of the Python community and uses the language in the way it is intended to be used. This is maybe...

 
user10984358
I will take a look at this
 
@AnttiHaapala True, but if that's the case here, Alc has worse problems to deal with. ;) I agree that explicit calling of dunder methods is usually a code smell, but dunder methods passed as an arg don't seem quite as bad, IMHO. And I must admit I occasionally do that with itertools filters like takewhile.
 
the Pythonic code for import this would be
from codecs import decode
print(decode(s, 'rot13'))
 
more like print('''<lots of text>''')
 
user10984358
how do you create a partial for str.replace that replaces spaces with nothing ('')
 
user10984358
8:59 AM
something like partial(str.replace,old=' ',new='')
 
>>> partial(str.replace,old=' ',new='')('a b c')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: replace() takes no keyword arguments
 
user10984358
end outcome is I have a list of strings and I have to pre process them so they are void of spaces and are lower cases
 
the truth is: you don't
 
How would y'all feel about a syntax that turns partially applied operators into callables? Something like {+3} -> lambda x: x+3, {3+} -> lambda x: 3+x, {+} -> lambda x, y: x+y?
 
user10984358
yeah thats why I asked how could you
 
9:01 AM
I saw rot13 being used for spoilers a few days ago. It might've even been some SE site I saw on HNQ. It gave me a nostalgic feeling for a moment. :) And made me realise that I can't read rot13 as fast as I used to.
 
user10984358
@Aran-Fey I didnt even know {+3} was legal python lol
 
ha, well, only by coincidence. That's a set containing the number 3.
 
user10984358
so you dont have to call set()
 
@Aran-Fey Intriguing, but if it's nestable it will lead to unholy messes.
 
@TheNamesAlc you need to, because there is no literal for an empty set.
 
user10984358
9:03 AM
about me "partializing" str.replace and str.lowercase
 
because sets were a later addition
I wish {} would be an empty set and {:} an empty dictionary.
 
If I really want stuff like that, I'll try learning Haskell again...
 
user10984358
at least any way I can like "map" these two ops to a single list without nesting?
 
@PM2Ring It's probably a bit too magical for something that's rarely used. Fits right in in Haskell, though.
@TheNamesAlc partial can't do that, you'll need a (lambda) function
map(lambda s: s.replace(' ', '').lower(), ...) or something
 
user10984358
9:07 AM
x=lambda x:x.replace(' ','').lower()
 
user10984358
yeah that
 
@Aran-Fey A better partial would be nice, though. I rarely bother using the current one. Not only does it restrict which args you can freeze, it's slow.
 
But this lambda talk reminds me of something I saw in the transcripts...
 
How would you improve it, though? Freezing positional arguments is a bit difficult. I suppose you'd need some kind of placeholder that indicates where parameters should go?
like partial(str.replace, placeholder, ' ', '')?
 
user10984358
str.replace(old, new[, count])
 
how about just adding iso8601 parsing module!?
 
user10984358
the docs indicate str replace as so
 
@TheNamesAlc docs are wrong
 
user10984358
lol
 
user10984358
9:11 AM
I always used partial for doing a "Reverse Forced Integer Sort"
 
user10984358
I call it revSort
 
continuing from yesterday, I did a test run of the sync using the sleep offset printing. youtube.com/watch?v=Ro8tUwWZtu4
 
> static str.maketrans(x[, y[, z]])
is this java?! shudder
 
And also a streaming method where the time is checked every 1024 frames which is more accurate for comparison. youtube.com/watch?v=csBDM14ssts
The streaming method, however, requires you to have the audio file locally but it should work for comparisons at least.
 
@TheNamesAlc you want to use help(str.replace) on Python 3.7 +
replace(self, old, new, count=-1, /)
    Return a copy with all occurrences of substring old replaced by new.

      count
        Maximum number of occurrences to replace.
        -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are
    replaced.
the / is the end of positional-only arguments.
docs are wrong.
 
9:15 AM
@louigi600 You can't put B1 in the lambda in B1 = Button(topframe, text ='Button 1', fg ='red', command = lambda B=B1: toggle_button(B)) because B1 doesn't exist yet. You've been given good suggestions: using bind is more flexible than using command. But if you do want to use command with lambda like that, the usual way is to set the command with a config call after you create the button
 
user10984358
sadly I am at 3.6
 
user10984358
its not a biggie to upgrade, its not like my laptop does NASA level operations
 
python.org/dev/peps/pep-0570 wait for Python 3.8 :P
 
user10984358
I guess I will then :)
 
user10984358
replace(...)
    S.replace(old, new[, count]) -> str

    Return a copy of S with all occurrences of substring
    old replaced by new.  If the optional argument count is
    given, only the first count occurrences are replaced.
 
user10984358
9:19 AM
this is what I get for help(str.replace) on 3.6
 
better than the docs, at least
 
user10984358
dont people have a need to do the same replace operations thereby creating a need for a partial?
 
@Aran-Fey True. Maybe some variation of f-string syntax?
 
9:35 AM
@Aran-Fey I'd prefer first-class expressions, something like symbols .a + 3 or quotes `a+3` being equal to lambda a: a+3
 
I'm getting a headache just thinking about turning {+-*-+} into real code mentally.
 
cbg patch
how does everyone do
 
@Aran-Fey nay
 
{*-*} looks nice though. :D
 
Oh man, old me did something really sensible! He left Eclipse in the exact setup needed to make an edit to an executable Jar and just rebuild it without doing anything but delete a line of Java in the already-open file. What happened to old me??
 
9:39 AM
But yeah, I don't think i'd be comfortable seeing code like that.
Nice work old roganjosh!
 
btw guys, is there any nice way of whipping up a virtualenv for a version of python you dont currently have installed (i.e.: it pulls it remotely when you configure the venv or some other thing like that)
 
> virtualenv for a version of python you dont currently have installed
Unlikely
I'm wondering about pyinstaller things :PP
 
I think conda offers pretty decent support for virtual environments, but You'd still have to install a python version when creating the environment by specifying it during environment setup
Pretty seamless though honestly.
 
@ParitoshSingh He's a lifesaver because I'm on the edge of sanity here :P Piling "you're gonna have to pick up Java again after 3 years" on me today would probably have been a tipping point :)
 
Well, I'm glad he did that for you then :)
 
9:43 AM
How to convert an array containing mixture of char and int to string?
Like ['R' , 0, 'E' , 1] to "R0E1"?
 
oh, i didnt really realize that Ubuntu is still using python 2.7
 
@TheNamesAlc I'm on mobile but how about map(operator.methodcaller('replace', ' ', ''), your_strings)?
 
or at least that is the default "python" on terminal
 
most linux distros will actually have python 2.7
 
@roganjosh not working, it say expected string found int
 
9:45 AM
@AjayMishra ''.join(map(str, items))
 
@AjayMishra that's probably a list, not array
 
@ParitoshSingh but isnt it supposed to be officially deprecated in like 3 months
 
@roganjosh int will break that
 
@AjayMishra convert all items to strings first
 
@AndrasDeak yeah, MisterMiyagi fixed it
 
9:46 AM
it took me ages to realise one could just use map there :/ been using ''.join(str(item) for item in items)) way too long ^^
 
@Skyler It is. And it will probably not be easy to phase out for distributions as well.
 
@Skyler it's been deprecated for a while :P
 
@MisterMiyagi You know, i actually prefer this version :P
 
so when the OS for a distro is using python does it tend to use 2.7 atm or 3?
 
@MisterMiyagi I think it will actually be slower than a list comp, though, since the iterator will have to be expanded to a full list before it can start joining
 
9:48 AM
@roganjosh Even if it didn't generator expressions are actually slower than list comps if you need to iterate through the whole thing. Just a quirk of the overhead i suppose.
 
Yeah, in the case of the syntax it replaces, that's also a generator expression so already slower than the list comp version
 
#Pretty sure the difference is really not worth fussing over though in the grand scheme of things.
%timeit sum(i**2 for i in range(50))
18.4 µs ± 228 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)

%timeit sum([i**2 for i in range(50)])
17.9 µs ± 193 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
 
yeah, str(item) is going to cost a lot more
remember that str is a O(n) lookup in a list-comp as well
 
@Skyler 2.7, but the distro uses Python for fairly simple tasks, barely needing most of the standard library, so the version isn't that critical. But I bet it's easier to maintain those Python scripts than the equivalent sh or bash scripts.
 
@PM2Ring use python3
 
9:54 AM
@ParitoshSingh Sure, not gonna quibble over the timings, but I'd say this was one of those areas where there's no active harm in using the faster version and that, unintuitively perhaps, the gen ex isn't helping
 
@AjayMishra Which distros do you know that do that? I suppose Arch probably does.
 
Aye, it's fine either ways. I just like gen expressions in these kind of tasks for readability personally.
 
mint do too.
```ajay@ajay-Lenovo-ideapad-300-15ISK:~$ python
Python 2.7.15+ (default, Nov 27 2018, 23:36:35)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
ajay@ajay-Lenovo-ideapad-300-15ISK:~$ python3
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.```
 
Can't use the backticks across multiple lines in chat. ctrl+k works.
there's also a pinned guide to formatting code in chat, to the right.
 
@roganjosh on Python3, map is the fastest version. PyPy3 is faster for the list comp.
 
9:58 AM
@AjayMishra Ok. But I'd be a little surprised if a majority of distros use Python 3 for their own internal purposes.
But I guess they'll have to fix that pretty soon. :)
 
@ParitoshSingh same here. I don't want a list, just the items joined. it's small things like these that make me wish for a compiler
 
Unsurprisingly, you're correct.
 
@ParitoshSingh Well, .join is a special case, since it has to scan the sequence twice, so it makes sense to pass it a list if you have the option. OTOH, sum can start work right away if you pass it a gen exp. True, the gen exp has a little more startup time, so summing a list comp is faster, on small lists. But if you have thousands of items, I bet the gen exp is faster (and of course uses less RAM).
 
But why is map faster than both?
 
@roganjosh as said, str is looked up globally. For map that happens once, for a comprehension it happens for every item.
 
10:05 AM
Yeah, im quite sure you're right on that
 
it's also why pypy is so much faster, their globals namespaces work much better
 
I was just cooking up a trivial example to say that even with the double scan, gen exps have enough overhead to still lose vs list comps
Actually, let me run a quick test too
 
Is there a reason that list comps have to do the global lookup each time?
I'm trying to think of a case where the operation for each item in the list could be ambiguous that forces a global lookup
 
@roganjosh str could change between steps
remember that builtins and globals are mutable
 
Clearly we need const foo = str syntax in 3.9
 
10:09 AM
well, we'll get final in 3.8 :/
 
#Make a mistake on the previous post
%timeit sum(i**2 for i in range(500000))
204 ms ± 4.96 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)

%timeit sum([i**2 for i in range(500000)])
217 ms ± 23.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
Sadly, 1 loop is not a good timeit
 
@MisterMiyagi hmm?
 
it's just a type hint, though
 
> to the typing module
 
%timeit sum([i+3 for i in range(500000)])

64.1 ms ± 5.62 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)

%timeit sum(i+3 for i in range(500000))
48.1 ms ± 1.43 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
 
10:10 AM
All good then :P
 
At this point the gen expression is clearly beating the list comp
 
I'd actually like to see something like const or final, but this attitude of ripping things straight out of Java feels alarming
especially since code is still as fast as ever :/
 
@ParitoshSingh Thanks for running the tests. The list comp is still doing pretty well, though, which shows us how well optimized the list resizing code is.
 
Ah, that's a pretty good point now that i think about it. You just made me realise i never really stopped to think about how a list comp makes the final list itself.
I assume it's forced to do big reallocations (of the whole list so far) in memory a few times during a single list-comp call, every time it "realises" that it's run out of slots in the current allocation for the list, so to speak.
 
it actually does that
list comprehensions use list.append, they just don't look it up
 
10:21 AM
but allocation doubles the underlying array's size I think, which leads to amortized log(N) cost or something
 
Ah, nifty! makes sense.
Yeah, i have read about how python overallocates memory every time a list is created in the past somewhere. It's a pretty clever workaround honestly.
 
10:42 AM
@AndrasDeak It grows a bit slower than that, generally. From github.com/python/cpython/blob/… The growth pattern is: 0, 4, 8, 16, 25, 35, 46, 58, 72, 88, ...
new_allocated = (size_t)newsize + (newsize >> 3) + (newsize < 9 ? 3 : 6);
So a bit faster than *1.125
 
@PM2Ring ah, I see, thanks
 
^ closed
 
Hello
 
11:20 AM
... I did it. I actually managed to get my site running :) It looks like I have to wait up to 24 hours for the DNS to work and get my domain to apply, then I can get a proper SSL certificate to get rid of the security warnings.
 
great job
 
Woot woot!
 
If anyone is bored, it's here. For now you'll get a security warning because I'm self-certified and the maps for the solved route won't show for the same https reason. The one thing I need to fix is the "PTV" screen but I'm exhausted tbh
 
flag and ignore
 
11:30 AM
"explain what X does" is pretty much an automatic "too broad/unclear" for me. even if you guess what the questioner needs, it is useless for most other people.
 
Aye. What's rough is, i get where the OP is coming from. It's a struggle grasping how so many different things connect together to make a CNN work, and then how that gets translated to code. And you can read a lot of articles and still not have a complete understanding on the topic. But that is pretty much the embodiment of too-broad.
 
Is there a way to save plain URLs in a text file (.txt) as clickable links i.e when I click on them they open in a browser through the use of python.
Is it possible?
 
Not really. the responsibility of "clicking opens a link to the browser" falls on whatever is displaying the final text data.
 
@ParitoshSingh yes, their question is valid, it should just not be asked on SO.
 
11:38 AM
text is just text. there is no such thing as "clickable"
 
even text doesn't exist
 
ah, is time for encodings again? :D
 
maybe :P
 
@roganjosh your site is amazing, you should publish medium articles on your algorithm.
 
@KartikeySingh Thank you, I really appreciate that :D I got impatient messing about with no results and knowing that deployment was gonna be a hassle so I pushed it out before I've actually got it exactly how I want. Both algos do a hell of a lot more than I've demonstrated
 
11:43 AM
@KartikeySingh Do you mean, is it possible for a Python program to display a plain text file containing URLs, which lets you click those URLs and then sends the clicked URL to a browser? Yes, that's possible.
 
@PM2Ring I mean is it possible (a library) that manipulates text editors to see plain urls as clickable links after saving them not during a python execution.
 
Currently I have to pay $20 a month for that server, knowing that compiling OSRM takes ~3GB RAM. Turns out the server is faster than my laptop so maybe I can be a bit more adventurous with the examples (though I need to think about how to make it not-boring to set all the parameters)
 
That is quite expensive
 
@KartikeySingh Which text editor?
 
11:46 AM
Yeah, I was gonna drop the specs down once I did the compilation.
But now it looks crazy fast so it's breaking my jQuery scrolling and making it seem a bit clunky, so I can re-think what I can actually solve on it
 
@PM2Ring actually it's any editor the user has, (like a code snippet) embedded in text file which when opens and execute it to make the links appear as clickable.
 
@KartikeySingh Try to sit and think through how data interacts with the tools we use to "see" data. You should end up realising what you're asking doesn't make sense/is not possible. If I write a plain url and open the file in notepad, it can behave very differently to writing a plain url and opening a file in excel for example.
 
Yeah, I see in scheduling algorithm it takes a little time for jQuery to load the dropdowns.
@ParitoshSingh I know it doesn't make sense but know I can show the client this chat details to satisfy him that it doesn't work.
 
@KartikeySingh How is this library supposed to hack into any random text editor?
 
For an analogy, you're saying "I'm writing a message in English. What special thing can i write in English that somehow makes a German person suddenly able to understand it". The point is, it's the person "reading" your message that dictates whether they understand English or not.
 
11:49 AM
@KartikeySingh That's select2. Is it not working correctly for you?
 
@roganjosh it is working fine it took 1-second (approx) delay that's all.
 
What browser are you using?
 
Chrome
It's actually not big issue as you are loading a lot of things from the back end.
 
Hmm, ok. I'm also on Chrome so I'll have to think a bit about what might cause that. The dropdowns are small so I wouldn't expect them to take long to load
 
@KartikeySingh OTOH, it's not too hard to write a Python program that will read a simple text file & convert it into simple HTML, converting any URLs to clickable links. Making it work perfectly on complicated text files is a little harder. ;)
 
11:52 AM
Maybe you can apply loader symbol and when behind it, if all things load then remove the loader.
 
@KartikeySingh I shouldn't need to do that, the options are sent from the backend so will be rendered with the entire page
Maybe that's an issue with nginx and loading templates with dynamic content that I haven't considered
 
On this page 167.99.91.216/production After real-time monitoring box, the performance review box takes time to load and all the boxes below it on my PC, that's why I was suggesting you can add a loader widget before all things load.
It still looks amazing
 
I appreciate your criticism btw, this is the kinda stuff I wanted
Oh, hurrah, this looks like it's a plotly.js issue then :/
Does it happen even when you refresh the page?
 
On simple refresh not but after cache clearing reload it does take time.
 
I can live with that (I think) :P
Maybe I need to hoist the import into the base template
 
12:00 PM
You shouldn't live but rather enjoy :)
 
12:15 PM
@KartikeySingh now you've said it, yep, I can recreate. Scrolling is awkward while the lower half loads. Thanks :)
 
@roganjosh looks awesome - great job mate
Strangely, I did something similar to 167.99.91.216/production a month or so ago using elastic/kibana as backend stuff
 
@JonClements thanks mate :)
I don't know either of those tbh, what problem were you solving?
 
@U10-Forward "ping me" -> @me :P
 
@roganjosh system monitoring, predictions and displaying reports on monitors connected to raspberry pis :)
 
Ha, that was my failed project but it turns out the Pis might have been more reliable than they seemed :)
 
12:23 PM
so the warehouse has a display for picking/orders unfilled/new orders come in etc... etc... and the office has one that's financials. warehouse floor throughput, system stability and forecasting... etc..
 
@JonClements what is your system?
Ours is borked and that's why I'm fighting so hard for change
After so many movements, the pallets need a new barcode and it's just nonsensical to me
 
@roganjosh just based around: elastic.co/products/kibana
and elastic.co/what-is/kibana-canvas for displaying some stuff
 
For displaying, we spend £2K a pop on a unit and then the price of the TV
But they keep blowing up because of the dust
A guard for the TV is some silly price, like £1K to be molded
 
umm.... I think in one area of the warehouse, it's just an android tablet, connected to a webpage that's chromecast to a cheapy LCD... think the client spent about £220 including a wallbracket...
 
Senior mgmt keep ranting at me about how important it is to make sure the shop floor knows where they're at vs the target.
Yet one of the PTVs has been broken for over 2 weeks and not one person told me :P
 
12:35 PM
 
Ahaha, you have the same smiley face as us :P
 
So I basically made sure all the data was being ingested from the appropriate places... talked the client through how to get various numbers, and then they made that for the warehouse... and they're making more or tweaking it without me having to get involved... it automatically updates live every minute...
 
@KartikeySingh Suppose you had a list of URLs and a description for each. You could display a numbered list of the descriptions, have the user enter a number, then use the webbrowser module to open a browser page with the requested URL. Since text terminals don't generally respond to mouse clicks, this might be a way to answer the need or it may not.
@PM2Ring Otherwise @PM2Ring's suggestion of building a temporary web page with the links in and opening that might serve.
@JonClements Nice work. Sounds like a cost-effective solution.
 
12:56 PM
Thanks - they're happy, so that's the main thing... :)
 
Certainly helps to get the bills paid!
 
1:19 PM
Now, I'm not sure how permissible this is since it mostly appears to be ignorable but I wonder if it accumulates.
Okay, so I used perf_counter to calculate the time drift using this code: pastebin.com/gxVLkEzv and the results are pastebin.com/pEu7QiEW
 
Just watching "Rick Stein's Road To Mexico"... seriously craving some enchiladas now...
 
@AndrasDeak did that, I think
 
2:20 PM
@aadibajpai I don't think you did, sleep(next(timer)) doesn't use pc anywhere. You seem to only use it to show how accurate you are. I gave you a link that does it that way, and a way that is more accurate.
 
2:46 PM
@Peilonrayz you're right, first I just wanted to check how much impact did the processing have on the time.
 
3:02 PM
ok nodejs is officially awful.
asynchronous callback programming is cancer
 
@PM2Ring Oh, cool... didn't know that. I'm shocked he does not receive a boatload of unsolicited pings emanating from room six new-users
 
Sam
3:25 PM
Hi guys
Whenever I print using a while loop, instead of seeing arround 200 lines, i just see 10 lines, and then "more"
i mean --more--
 
how are you running that program?
python my_script.py | more?
 
Sam
[  DEBUG  ] Submitted form, writing to file....
-- More  --
No, just python script.py
never mind
i do use python script.py | more
 
00:00 - 16:0016:00 - 23:00

« first day (3235 days earlier)      last day (1731 days later) »