Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:


hbag balls

Adbot
ADBOT LOVES YOU

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Smythe posted:

the thing only tabulates the first 50 probes which makes it worthless kuz the real good numbers will come from cool ppl who have pages and pages of probies. sorry

edit: got a pm seconds after posting this (????)

thank you for the update smythe, and he’ll, i agree

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

check this out. its just sad

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Jonny 290 posted:

holy the gently caress the fetch time on these is insane we need to get you behind a CDN my fellow poster

hook them up with some free fastly credits or something

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

im seeing like 900ms over here

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

AnimeIsTrash posted:

If you have a .edu email, digitalocean used to give out a $100 voucher. I think the lowest tier of hosting is about $5 a month so you can get a little under 2 years worth of hosting out of it.

vultr’s lowest tier is $3.50 a month for a similar type of vps, they also have some kind of sign up bonus. if you really want to cheap out like me

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

hbag posted:

honestly im pretty sure that's because atm im not caching the images so it's doing the math again every single time (the responses are cached to keep the script from sending like 6 billion get requests)

tonight im gonna work on caching the images tho

sounds like its time for redis

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:


n00b

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:


you’res is fake

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Sagebrush posted:

yeah no that 100,000-hour probe only locked you out for less than a day. this is stolen valor.

exactly.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

thank you for merging my pull request, op

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

hbag posted:

is that some kind of tool that abstracts this torment so i just tell it what i want it to do and then it generates the yaml poo poo for me
because this specifically needs a yaml thing im pretty sure

azure is microsoft aws

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Smythe posted:

your users dont know they have a cisco ip phone. its just "the phone"

not only do they not know. they don’t want to know and don’t care

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

hbag posted:

quick give me cool ideas for lovely web toys to make for the forums
i will work on them alongside my badges

a service you can subscribe to that autosnypes the thread of your choice

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

something that scans ppl’s post history to figure out which forums are their regular forums they post in

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

a toribot that interrupts ongoing discussions about x by posting “x is from pittsburgh”

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

how about an autobumper to keep your favorite threads from falling off the first page

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

a client like awful app but it only shows you the good posts

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

eschaton posted:

a forums authentication provider

say I want to prove I own the forums account eschaton

I create an account in your app, tell it my forums username is eschaton, and it gives me some derived hash to put on my profile

I put the hash on my profile and tell your app “ok, verify me,” now it knows the app account and the forums account are related—and I didn’t actually have to give you or anyone else any “real” info about myself

and your app can act as an OAuth provider that confirms my forums identity

so if someone makes some other app for forums peeps, they can just use an OAuth flow for a “forums login identifier” such as https://forums-auth.hbag.com/eschaton (or whatever your app server and domain is)

now that other person’s app can trust it’s being used by forums poster eschaton and not someone pretending to be me

yo hbag if you actually did this it would be pretty impressive to future employers i bet

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

it’s a few steps up from serving a png file with flask, sure

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

hbag posted:

well anyway now im trying to figure out if there's a way to test if an image is entirely transparent
as in, test if the image is nothing BUT transparent pixels, no color whatsoever

if you dig in to the png spec youll find this shouldnt really be that hard. start here: https://www.w3.org/TR/PNG/#11transinfo

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

hbag posted:

welp after reading this im not sure if theres an alpha channel for the ENTIRE image's transparency or if there's only alpha channels for individual pixels

realistically your image library probably can do this for you. without having used it before i'd probably try this method and see if the max value for the alpha band is 0, assuming there is an alpha band

https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.getextrema

idk if that will actually work but read the docs imo

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

hbag posted:

i dont think checking the transparency of a pixel at most 32,400 times is very efficient
ill give it a try

32,400 is not a big number for a computer though

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:



whatever server that repl.it feels like letting me use for free was able to compare 32,400 integers to 0 in under 7 milliseconds

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Sagebrush posted:

i have a ryzen with 24 logical processors.

sounds like you could handle a whole megapixel sized image with that bad boy

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

hbag posted:

in a shocking turn of events it actually worked first time
hoiy poo poo

pro tip: if you use a statically typed compiled language you’ll encounter this more often imo

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

rotor posted:

hbag, are you familiar with nntp

lol

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

mystes posted:

You can just iterate through the pixels and check the alpha value, but unless people are using giant transparent avatars maybe you should just check whether the avatar is like 5x5 or smaller?

yeah and because this problem is embarrassingly parallel you can parallelize it for efficiency, each “process” only needs to check one pixel each and your result is still accurate

code:
from multiprocessing import Pool

def is_transparent(alpha):
  return alpha == 0

# imagine this is a sequence of every pixel's alpha value
alphas = range(32400)

if __name__ == '__main__':
  with Pool(processes=32400) as p:
    x = p.map(is_transparent, alphas)

  print(all(x))

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

mystes posted:

Fart simpson is just trying to make everything complicated.

i already posted a link to the pillow docs for the built in method that tells you the min and max pixel values for an entire band of the whole image :shrug: seems pretty simple and useful here to me

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Storysmith posted:

okay so the code assumes you have a 1-dimensional list that has all the pixel values of your av image.
it defines a function that tells you if the image is transparent or not, and then starts a (lightweight thread, i think is the default?) pool of executors that each take a single entry in that list and calculate if that pixel is opaque or transparent, and then the all() (iirc) tells you if any of them are opaque

the use of the map function there is some unintuitive stuff to newcomers — you’re not calling the is_transparent function in that map line. you’re passing the function itself in as an object that then gets called by map() with the proper alpha array entry for each one in the list.

i can never remember what the technical cs term for it is but it’s one of those things that broke my mind when i learned ruby from a codebase full of people who loved map and filter and the like.
rip vine

actually from what i can tell in the docs, it forks 32,400 new python interpreter processes and sends the alpha value of one pixel and the is_transparent function to each process. each process calls is_transparent on the value of the one pixel it was assigned, and passes the result back to the main process. the main process collects all the results and puts them into a sequence called x, and all() tells you if all of them are transparent, or at least one isn’t transparent

so basically what you said but it’s forking a new process for each pixel to maximize parallelization

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Sagebrush posted:

As noted earlier a single threaded version checks the whole avatar in 7 milliseconds so you could have people doing this 12 million times a day on average before you even start to overlap requests, let alone produce noticeable lag.

that 7 milliseconds also included constructing the list of values and printing to console too!

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

eschaton posted:

it’ll just be so much pain to write in the first place that you’ll decide to do something else

op use Lisp not Haskell

use both imo

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

amazing that the fake venezuelan president is also the guy who unleashed python on the world. what a piece of work

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

hbag posted:

honestly i barely even know what an svg is

svg is cool. this is an svg i whipped up by hand in notepad.exe, that’s how easy svg is

https://forums.somethingawful.com/showthread.php?threadid=3967994

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

lol never mind the svg share hosting website didn’t pay their bandwidth bill

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

is this the “everyone liveblogs about hbags posts” thread?

Adbot
ADBOT LOVES YOU

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply