User Controls

  1. 1
  2. 2
  3. 3
  4. ...
  5. 107
  6. 108
  7. 109
  8. 110
  9. 111
  10. 112
  11. ...
  12. 136
  13. 137
  14. 138
  15. 139

Posts That Were Thanked by NARCassist

  1. cerakote African Astronaut
    Originally posted by anra your iq is like low 130s, just like 75% of the forum

    why do you think that iq means very much?

    its like i have a big fucking chunk of a cobalt blue diamond. it has just been taken out of the ground, so its unpolished, uncut, and unprocessed. its a cool diamond! its cobalt blue which looks fucking sick, and would only look better after becoming a shiny, angular, piece of expensive. but i just sit and circlejerk about my diamond rock and how much it could be worth or how nice it would look after some work, or generally fucking off instead of making those visions into reality.

    thats you and your dumb gay iq. instead of making a contribution to society you would rather just sit like a wart on the ass end of a bridge troll and just talk about how smart you are when people who "are dumb" are running laps around you in life.
    The following users say it would be alright if the author of this post didn't die in a fire!
  2. Lanny Bird of Courage
    Kinda unlikely anyone here is going to care, but I have this piece of code I've been copy pasting between Django projects for years because it addresses a really common situation in a way I think is quite neat relative to the approach you typically see used in the docs and such. Might be worth some SEO points or something. Also possibly useful to the couple of you who poke through the ISS code now and then because it's used pervasively there.

    The situation is you have some view (the thing that handles an incoming HTTP request) and you want to do something different when a client does a GET request vs. a POST request vs. something else. This is done constantly with form handling, GET should present a form POST should validate the form and either represent with error messaging or take some action if the form is valid. The usual approach is to look at the request method in your view and branch according to what you want to do. It typically looks like this (taken from django docs):


    def get_name(request):
    # if this is a POST request we need to process the form data
    if request.method == 'POST':
    # create a form instance and populate it with data from the request:
    form = NameForm(request.POST)
    # check whether it's valid:
    if form.is_valid():
    # process the data in form.cleaned_data as required
    # ...
    # redirect to a new URL:
    return HttpResponseRedirect('/thanks/')

    # if a GET (or any other method) we'll create a blank form
    else:
    form = NameForm()

    return render(request, 'name.html', {'form': form})


    If these alternative paths get long however this quickly becomes unreadable. Half the function is doing one thing and half is doing something else. Gets worse the more methods you're trying to support. So enter MethodSplitView:


    class MethodSplitView(object):
    """
    A flexible class for splitting handling of different HTTP methods being
    dispatched to the same view into separate class methods. Subclasses may
    define a separate class method for each HTTP method the view handles (e.g.
    GET(self, request, ...), POST(self, request, ...) which will be called with
    the usual view signature when that sort of request is made.

    Subclasses may also define a `pre_method_check` method which, if it returns
    a HttpResponse, will be used to response to the request instead of
    delegating to the corresponding method.
    """

    def __call__(self, request, *args, **kwargs):
    if getattr(self, 'active_required', False):
    if not request.user.is_active:
    return HttpResponseForbidden('You must be an active user '
    'to do this')
    if getattr(self, 'staff_required', False):
    if not request.user.is_staff:
    return HttpResponseForbidden('You must be staff to do this.')

    meth = getattr(self, request.method, None)

    if not meth:
    return HttpResponseBadRequest('Request method %s not supported'
    % request.method)

    response_maybe = self.pre_method_check(request, *args, **kwargs)

    if isinstance(response_maybe, HttpResponse):
    return response_maybe

    return meth(request, *args, **kwargs)

    def pre_method_check(request, *args, **kwargs):
    return None

    @classmethod
    def as_view(cls):
    if getattr(cls, 'require_login', False):
    return login_required(cls())
    else:
    return cls()


    https://gist.github.com/RyanJenkins/258723c74485fb01ee85272075bad967

    Essentially this the behavior here is to look at the request method and pick a method from the subclass with the appropriate name and delegate request handling to that. So submission logic lives in one method, inquiry logic in another. On the whole it's a lot easier to visually parse quickly. One downside is that sharing logic between multiple methods is harder here, in my experience the vast majority of shared logic between methods is in the form of some kind of auth check (is the user logged in, do the have the appropriate privileges, etc) so I added a `pre_method_check` method that subclasses can specify to do this check and optionally return a response (preventing delegation to other methods). There are more opportunities for reducing boilerplate but generally at the cost of flexibility, empirically this seems to be the sweet spot and any other logic sharing can be delegated to private methods that request handling method call.

    For a concrete example, here's the user registration method using this "pattern" (kinda hate that word):


    class RegisterUser(utils.MethodSplitView):
    def pre_method_check(self, request, *args, **kwargs):
    if not utils.get_config('enable_registration'):
    return render(request, 'generic_message.html', {
    'page_title': 'Registration Closed',
    'heading': 'Registration Closed',
    'message': ('Registration is temporarily closed. Check back '
    'later to register a new account. If you think '
    'this is in error, please contact the '
    'administrator.')
    })

    def GET(self, request):
    form = forms.RegistrationForm()
    ctx = {'form': form}
    return render(request, 'register.html', ctx)

    def POST(self, request):
    form = forms.RegistrationForm(request.POST)

    if form.is_valid():
    poster = form.save()

    poster = authenticate(username = form.cleaned_data['username'],
    password = form.cleaned_data['password1'])
    login(request, poster)
    return HttpResponseRedirect('/')

    else:
    ctx = { 'form': form }
    return render(request, 'register.html', ctx)
    The following users say it would be alright if the author of this post didn't die in a fire!
  3. LegalizeSpiritualDiscovery Space Nigga [my yellow-marked arboreous hypnotist]
    Originally posted by anra inb4 you smoke carfentanil

    Originally posted by NARCassist you're not doing it right




    .
    The following users say it would be alright if the author of this post didn't die in a fire!
  4. Sophie Pedophile Tech Support
    7Up commercials trigger my thirst. I personally dislike alcohol. The trade off sucks, a mediocre buzz for a shitty hang-over.
    The following users say it would be alright if the author of this post didn't die in a fire!
  5. Sophie Pedophile Tech Support
    Originally posted by Captain Falcon Like literally basic facts about even the nature of Obamacare holy shit lol.

    Basic facts according to you? Aren't you supposed to be rich? You know all about economics right? So tell me, what happens when you force insurance companies to take on people with pre-existing conditions? 1. Premiums go up massively. 2. Everyone just cancels their plan until they get sick. To keep the fucking scam going Obamacare just forces everyone to get healthcare and pay the premiums. That's the real reason for Obamacare. You're delusional if you actually believe the government is this big old humanitarian organization that gives a single shit about the welfare of it's citizens.
    The following users say it would be alright if the author of this post didn't die in a fire!
  6. Discount Whore 2.0 Houston [retell my unflavored scrape]
    anyone who argues pigs are filthy hasnt been on a farm and seen the rest of the animals
    The following users say it would be alright if the author of this post didn't die in a fire!
  7. Malice Naturally Camouflaged
    I never eat breakfast at all, intermittent fasting.

    Pigs are only filthy due to the abhorrent conditions the vast majority are kept in. Regardless, it's not as if fecal matter becomes intrinsically enmeshed into muscle tissue. Any exposure is largely external.

    What about cows? Do you know how fucking filthy the CAFOs they're kept in are?
    The following users say it would be alright if the author of this post didn't die in a fire!
  8. HampTheToker African Astronaut
    You should have a coffee together.
    The following users say it would be alright if the author of this post didn't die in a fire!
  9. HampTheToker African Astronaut
    Originally posted by infinityshock not today.

    Not ever. That's the fucking problem. I could excuse your dumb-kid-that-just-discovered-the-internet mentality if it was even just a little bit funny, but it's not. It's like you got stuck in 1999 after a traumatic brain injury.
    The following users say it would be alright if the author of this post didn't die in a fire!
  10. kroz weak whyte, frothy cuck, and former twink
    nice, i haven't done H in a couple years, I used to be all about it. like 8/9 years ago. About 6 months ago I went to the area near the university where I would score and they really "cleaned" up that area.

    the main drug around here everyone is into now is meff. its funny how some people are with their drug of choice are, a lot of meff heads around here have a superiority complex and look down on heroin users but once twacked or they've been doing it awhile won't mind slamming.

    my drug buddy who is now dead used to do heroin with me and quit and just started smoking meff all day errrr day. Going on about how he will never do heroin again. I eventually stopped hanging out with him because he was a drug jedi and starting getting annoying when we'd smoke speed.

    I found out months later that he started doing heroin again and died. For being college educated and coming from a very well off family the guy was kind of a ree ree.
    The following users say it would be alright if the author of this post didn't die in a fire!
  11. Helladamnleet African Astronaut [impartially tyrannize that lentinus]
    That looks fucking disgusting.
    The following users say it would be alright if the author of this post didn't die in a fire!
  12. HampTheToker African Astronaut
    Originally posted by infinityshock the only pics that bitch will ever post are ones of him getting corn holed by a pack of unwashed somalian niggers.

    I wish you were funny. I really do.
    The following users say it would be alright if the author of this post didn't die in a fire!
  13. HampTheToker African Astronaut
    Just pay her to fuck and get it over with. You don't want to date a hooker. You might think you do, but you don't. Not really. Pay her, fuck her, and don't forget the condom.

    ...falling for a hooker.

    If I were there I'd have to smack you upside the damn head on principle. The fuck is wrong with you, man?
    The following users say it would be alright if the author of this post didn't die in a fire!
  14. benny vader YELLOW GHOST
    I had the exact same thought as the OP.

    The following users say it would be alright if the author of this post didn't die in a fire!
  15. Originally posted by anra i operate on a whole different level than you. it's irritating that you think you possess any genuine intelligence. you rehearse facts with absolutely 0 ability to extrapolate for personal conclusions. its like if life was a 3D simulation your cpu can only render it in 2D. i literally see you as like a cardboard cutout of a human who cant understand anything beyond whats immediately presented. case closed.

    Lol sub-average IQ confirmed. Does operating on a whole other level include chugging Listerine and getting your ass kicked by your dad when you tried to murder your parents?
    The following users say it would be alright if the author of this post didn't die in a fire!
  16. Sploo, why are you so insecure about being your stupidity, baby boy
    The following users say it would be alright if the author of this post didn't die in a fire!
  17. RisiR † 29 Autism
    Why would you throw a ping pong ball at a stripper?

    Did they shoot them back with their pussies?
    The following users say it would be alright if the author of this post didn't die in a fire!
  18. wow such a hardcore lil boy

    try real man drugs you goddamn loser
    The following users say it would be alright if the author of this post didn't die in a fire!
  19. aldra JIDF Controlled Opposition
    posts some thoughtful stuff when he's not trying to force memes and gimmicks


    Originally posted by RisiR † He will die one day.

    Usually a good guy, has posted some of the most amusing stuff on the site. Gets highly unpredictable sometimes, probably benzo-related

    Originally posted by infinityshock nigger cock sucking faggot jedi fag

    has a lot of insight relating to military and geopolitics, though it's often hard to see past the monotonous rapethreats.

    Originally posted by cerakote is really good at getting banned for taboo

    surprisingly functional for a meth user. aside from gaychan memes has some interesting posts. also the only one who argues with IS in an amusing fashion.

    Originally posted by Captain Falcon My favourite poster on the site.

    Nut up and be positive, you gays.

    Most intelligent Paki I've talked to. I actually believe that he's rich through selling his advertising business - dunno if that makes me retarded, but seems reasonable to me.

    ***Forgot Bill Krozby

    Originally posted by Bill Krozby ^RETARD!

    Would probably find this guy repellant in real life; he sounds like a wifebeater with zero impulse control.
    As a poster he's improved a lot since he slowed down on the drinking; posts some decent stuff but relies too much on expecting people to watch videos instead of actually starting a discussion

    Post last edited by aldra at 2017-07-28T06:25:05.563553+00:00
    The following users say it would be alright if the author of this post didn't die in a fire!
  20. infinityshock Black Hole
    Originally posted by NARCassist hoping i am as successful stretching out riding her like a fucking freight train too.

    youre going to be stretched out when that tranny-hooker whips out his freight train and rides you
    The following users say it would be alright if the author of this post didn't die in a fire!
  1. 1
  2. 2
  3. 3
  4. ...
  5. 107
  6. 108
  7. 109
  8. 110
  9. 111
  10. 112
  11. ...
  12. 136
  13. 137
  14. 138
  15. 139
Jump to Top