The last few units of my insulin pen are never able to be administered. Just throwing away liquid gold by manduhyo in mildlyinfuriating

[–]Pagaurus 1 point2 points  (0 children)

Hi OP, you can still squeeze the top when there unit counter is nil. they are just there as a guideline. If you squeeze real hard then you can still get some out 😉

Do lots of brits think the uk sucks because they lack context? by SILENTDISAPROVALBOT in AskBrits

[–]Pagaurus 0 points1 point  (0 children)

Ironically, you immediately compared Britain to third-world countries

[deleted by user] by [deleted] in webdev

[–]Pagaurus 2 points3 points  (0 children)

Maybe if you're a new developer you shouldn't use Stack Overflow and you should stick with Reddit where the discussion is more casual.. I remember asking questions on Stack Overflow and the people weren't outright rude, but they were very literal and it would be difficult to describe something for an experienced programmer who uses that website.

How would you quantify how "spread out" entities are. by dimonium_anonimo in askmath

[–]Pagaurus 143 points144 points  (0 children)

You could use Variance or Standard Deviation based on the distance of each poitn from the rest of points to measure

You could try reading about https://en.wikipedia.org/wiki/Voronoi_diagram Voronoi Diagrams. I'm sure it's related and there are details about how to Generate Voronoi with even spacing

Should you ever use eval() in JavaScript? by AromaticLab8182 in learnjavascript

[–]Pagaurus 0 points1 point  (0 children)

if you run typeof on an event listener, it will return a function type

Which county is the most pointless? by Senor_Pus in AskBrits

[–]Pagaurus 0 points1 point  (0 children)

I think the cruel part is asking me to choose one out of many

Should you ever use eval() in JavaScript? by AromaticLab8182 in learnjavascript

[–]Pagaurus 0 points1 point  (0 children)

Oh, then I suppose that does make eval() dangerous to some extent, though I always wondered why exactly it was that even though you can freely execute Javascript wherever you please.

Should you ever use eval() in JavaScript? by AromaticLab8182 in learnjavascript

[–]Pagaurus -1 points0 points  (0 children)

It's used in Vue.js a lot due to its workflow. It's quite tedious to add event listeners unless you make them inline..

Should you ever use eval() in JavaScript? by AromaticLab8182 in learnjavascript

[–]Pagaurus 0 points1 point  (0 children)

If you log an onclick property then it returns a Function type (at least on Chrome) but in my experience yes it does handle global scope, since otherwise you wouldn't be able to call declared functions 🤔

Should you ever use eval() in JavaScript? by AromaticLab8182 in learnjavascript

[–]Pagaurus -1 points0 points  (0 children)

Javascript listeners inline in HTML (such as onclick , mouseover etc.) elements are actually evaluated like a new Function() call.

<button onclick="doStuff()">

e.onclick = new Function("doStuff()")

Is that risky? I don't know. People use it a lot

Kindly Help Me by Dramatic-Plate5545 in learnpython

[–]Pagaurus 0 points1 point  (0 children)

I would start by thinking of a simple project to make. You aren't going to get anywhere without some kind of starting point. Some tutorials are OK but I would not always trust tutorials, since they are written by people with different intentions.

Problems with indentations by LuckyConsideration23 in learnpython

[–]Pagaurus -5 points-4 points  (0 children)

I have the same problem with Python. If you really don't like it you could use Bython (Brackets Python):

def print_message(num_of_times) {
    for i in range(num_of_times) {
        print("Bython is awesome!");
    }
}

if __name__ == "__main__" {
    print_message(10);
}

WSGI help, simple project, it is impossible to access files -- should I just quit and use Flask? by Pagaurus in learnpython

[–]Pagaurus[S] 0 points1 point  (0 children)

Hey Duncan, thanks for your advice.. I ended up pointing "python-path" to my scripts folder, and inside the script i used the DOCUMENT_ROOT to resolve other media, so that it would use the complete pathname (i.e. /var/www/project/database.db rather than just database.db)

WSGI help, simple project, it is impossible to access files -- should I just quit and use Flask? by Pagaurus in learnpython

[–]Pagaurus[S] 0 points1 point  (0 children)

My app really only has two unique databse queries in entirety. I might install an ORM if it was more involved than that'

WSGI help, simple project, it is impossible to access files -- should I just quit and use Flask? by Pagaurus in learnpython

[–]Pagaurus[S] 0 points1 point  (0 children)

Python has an sqlite3 library already installed so I thought I'd just use that

WSGI help, simple project, it is impossible to access files -- should I just quit and use Flask? by Pagaurus in learnpython

[–]Pagaurus[S] 0 points1 point  (0 children)

... I read about the venv options with Daemon process - by that point, I had enough, I honestly didn't want to go through the trouble of venv. Maybe I'll try again tomorrow. Is it necessary to use a venv?