« first day (4487 days earlier)      last day (686 days later) » 

01:55
@PM2Ring thanks for catching that. what an embarassment
@12944qwerty executable size depends on the compilation process rather than the language. In particular, it depends a lot on the approach taken to figuring out what libraries are needed, and on whether they are statically or dynamically linked
you can "make" a minimal .exe that's only a few bytes "with" any programming language - if you use that programming language to make a short program that outputs the .exe
that said, generally Python is not designed for making standalone .exes, and the third-party processes that do this, will take a relatively quick-and-dirty bundling approach.
generally, these exes are going to embed an interpreter for Python's bytecode, rather than actually creating machine code. However, there are alternatives that will attempt the latter, such as Shedskin.
@Kevin how are programs intended to determine the point where the zip data starts?
Is there any python package that performs tasks similar to what the hparm application (man7.org/linux/man-pages/man8/hdparm.8.html) performs?
I can't install Linux programs on the system I'm using, but Python packages I can install in my Python environment.
hdparm *
02:23
hdparm requires root, if you can't install Linux programs onto the system you are using due to lack of having root, well, I don't know what to tell you
Ok, thank you. As a last resort, I can ask the system administrators to install it. There is probably no alternative.
 
1 hour later…
03:34
@KarlKnechtel No worries. ;) A few weeks ago I was looking at one of my old answers (I can't remember which site) and noticed a simple typo in an equation, maybe a sign or off-by-one error. The answer was several years old, with 5 or 6 upvotes...
In the last couple of weeks I've been bitten twice by typos in well-known mathematics papers from the 1970s & 1980s. They both had something like (1+x)² instead of (1+x²). I was trying to implement their algorithms in Sage / Python and wasted hours looking for bugs in my code before I realised that the bug was in their equations. :(
03:59
@Marco The system probably has hdparm. But as the manpage says, some of its options can be very dangerous: not only can they destroy data, they can brick the drive. Programs like gparted can do some of the stuff that hdparms does, but if you don't have root permissions I doubt that the system admins will let you use such potentially destructive tools.
What do you intend to do with hdparms? If you only need its benign options that give low level info about the drive then perhaps there are safe alternatives that you can access. Do you know about the /proc filesystem? en.wikipedia.org/wiki/Procfs
I just intend to do simple benchmarks.
I'll double-check the existence of hdparm in the system, maybe I typed the name wrong.
04:37
Yeah, I checked, there's no hdparm on the system. But I had even forgotten what metatoaster said a moment ago, even if there was hdparm in the system, I wouldn't be able to use it, because I would need root access, and it's something that I can't have (neither I nor the other users of system).
As for the dangerous options, yeah, I've had a look, and I'd stay well away from them. About procfs, well, I don't think it would serve my purpose of benchmarking.
But thank you very much!
05:34
block = lines[sorted_indexer[i]+1:sorted_indexer[i+1]]
any way i could write the above without writing sorted_indexer twice?
 
2 hours later…
07:38
@PM2Ring yeah, the reproducibility of academic papers is very often questionable, my colleagues trying to reproduce papers related to equations from computational biology often run into very interesting issues - if the author is still alive it's typically easy to resolve, but that's now sometimes not the case
08:06
hi @PM2Ring & others
08:56
@PM2Ring yeah, I recall that being the case (wasn't born at the time, just was looking around on retrocomputing.SE and the like)
 
5 hours later…
14:22
I just did some cleanup on stackoverflow.com/questions/21892989; thought people might be interested
stackoverflow.com/questions/75240404 I couldn't figure out how to explain to OP what's missing from this question, would appreciate backup
in particular: I assume that db.fetch is expecting a data structure, rather than a JSON string, but OP isn't being particularly clear about the type of - well, anything in the code.
but maybe it's perfectly answerable with the information currently in the comments, and just needs an edit plus the attention of someone who actually knows streamlit (whatever that is)?
14:55
i'd like to be able to run a python program in interactive mode, and be able to print text on a separate window. any tips on where I could start looking into how to do that?
so if i write:
special_print('hello world')
in the window with interactive mode, the second window would print:
hello world
i'm looking for the second window to look like a cmd interface too, such that additional prints stay unless I clear them, so not something like a tkinter pop-up
Does anyone know how to plot a best fit curve in Python for data that satisfies the inverse-square law? I tried

import numpy as np
from scipy.optimize import curve_fit

x = np.array([1, 2, 3, 4,6,8])
y = np.array([660, 160, 72, 42,20,10])

def fit_func(x, a, b,c,d):
return (a*x+d)/(b*x + c)

params = curve_fit(fit_func, x, y)

[a, b, c,d] = params[0]

# print(a,b,c,d)
print((a*3.3+d)/(b*3.3+c))
When I changed

def fit_func(x, a, b,c,d):
return (a)/(d*x^2 + c)

I got an error

File "/home/jaakko/model.py", line 8, in fit_func
return (a)/(d*x^2 + c)
TypeError: ufunc 'bitwise_xor' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
15:37
Is used ** not ^ to exponentiate in Python
^ is bitwise XOR operator
16:12
@JaakkoSeppälä ^ is not the exponentiation operator in python
Ah, Marco beat me to it sorry
Yes, this time I managed to answer something, I usually don't have the knowledge to answer things here.
I didn't immediately notice the problem (I hadn't checked the details of the math function yet), I just googled the error and the first result that came up was the SO link I showed.
16:34
Linkedin has recommended a post on the 5 most common reasons why CVs are unsuccessful from a "Career Transformation Expert". The subtitle of the presentation is - "You are doing this costly mistakes". I really hoped there was some irony to be had in that typo but... nope, never mentioned
 
2 hours later…
18:35
@shintuku you're going to want to talk to experts on your operating system first, in order to understand what the steps are mechanically; then you can look into how to implement them from python
hi, did guido van rossum said something like "python never intended writing 10k lines programs" ?
18:54
not that I've heard of.
19:07
I'm trying to image classify with Keras Efficient Net. like here keras.io/examples/vision/… I have two folder named 1 and 0. The number of images in both folders is the same. F1 score is generated only for 0 class in sklearn report results. f1-score for class 1 is always 0. classifies everything as 0. How can I fix ? I would love any help.
20:00
@shintuku Not exactly. Sure, the repetition is slightly annoying, but what you've written is easy to read, IMHO. However, you could do something like this:
lo, hi = sorted_indexer[i:i+2]
block = lines[lo+1:hi]

« first day (4487 days earlier)      last day (686 days later) »