codingdir logo sitemap sitemap |

Implementing an Anti Spamming thing?

By : , Category : python

Your logic should be enough. If you have say:

    if flood.has_key(userName):
        flood[userName] += 1
        flood[userName] = 1
    if flood[userName] > say 8:
        return 0

That should make your bot ignore the user if he has spammed too many times within your given time period. What you have there should also work to clear up your flood dictionary.

ReLated :

According to Mathias Verraes' excellent presentation Unbreakable Domain Models, he mentions Value Objects are the "heart and soul" of programming. So I think the ultimate answer is to not be shy when it comes to using Value Objects.

However, after thinking about the type of validation I mention in my question (cleaning characters out of these names, etc.) I have decided I can shift this to a form input handler class. It feels a little better to do some cleaning at the "application level" before getting to the domain. Of course, if I start to have any validation that requires domain logic then I should be doing that at the domain level always. And I think the Carbon dates should stay. I also have a property called "urlSafeName" (or slug) which I'm considering making a Value Object (takes a string and turns it into a more "pretty url" form).

I'm still a bit worried about VO's that hold arrays and which could be substituted for very small tables in a database. For example, a VO for a job title which comes from an array of job titles (President, CTO, Lead Developer, etc.). I'd have to be sure the array is going to stay at a manageable size, that size is of course going to be subjective though. If I have an address VO with a cityId, stateId, and countryId, then I probably want to just store them as Ids and not store all the names of those cities, states, and countries in the VO (but should be in a lookup table in the database).

Easy answer: Don't. This may be a sensible thing to say if the user is using TalkBack Gestures. But what if they're using an attached USB keyboard in conjunction with TalkBack? Is this really the ONLY way to reach those items. Probably not. And if it is, you're app may work great for TalkBack gestures, but is broken for switch access and keyboard access. TalkBack users know how to use TalkBack, switch users know how to use switches, etc. Use good, common design patterns in your layouts, and let users figure things out for themselves.

Let's explain this in a different way. Let's say you have a button. You have marked this thing up so it looks like a button. Do you have a big sign next to your button that says "HEY, CLICK YOUR MOUSE HERE TO ACTIVATE THIS BUTTON"... no of course not. Users know how to use buttons. Use reasonable design idioms, and users should understand how your UI works, independent of whether they are using TalkBack, Switches, Keyboards, etc. It is misleading, inappropriate, and actually LESS accessible to include TalkBack gesture specific instructions on how to perform actions.

See WCag 2.0 Guideline 4.1

Well, the reason why you can't come up with solution is because you don't have implementation, but rather business problem.

Once business policies are defined, implementation will be easy.

For example, Amazon allows ordering or products that are running out by saying "we'll deliver in 2-4 weeks". Meaning, you can still order, you'll just get product later / emailed once it's on the way.

In your case, however, if you have finite resources (seats / movie tickets) - you can start putting people in waiting list. Like, warn them that you are running out of seats, but allow them to complete process normally. Then as you are processing payments, you can send more detailed emails to those who are left without seat. Kinda like airlines do. Once you sort out those who really bought tickets refund those who are left without seats.

If your problem is deeper (like you are thinking about blocking individual seats) - definitely think more about business policies. Like, do you really need to go down that level? Can't you do what airlines are doing (sell tickets for certain class first, and then later allow users to pick seats)? Again - core of your problem is business, rather than implementation. Once use cases are properly defined, you'll probably just need to use standard database locks.

The most important thing in processes like this is transparency. Be honest with your users. Keep them informed through the process and don't try to trick them - like show more seats that there really is, just to incentify them to complete the purchase.

You need to make sure you add QFont::PreferAntialias to your font.setStyleStrategy call. Like so:

font.setStyleStrategy(QFont::NoSubpixelAntialias | QFont::PreferAntialias);

Message :
Login to Add Your Comments .
How to disable registered OpenCL platforms on Windows?
Is Observable broken in Angular 2 Beta 3?
Cross-thread operation not valid when using Invoke
How to pass an IEnumerable or queryable list of properties from Controller to View
Finding numbers after a certain keyword using Python
Pocketsphinx recognizes random phrases in a silence
Passing non-thread-safe objects through thread-safe containers
React scroll nav
BizTalk WCF-BasicHttp Adapter does not allow Empty string for Service Certificate Props
Why property ''cause" of Exception is repeating forever?
Privacy Policy 2017 © All Rights Reserved .