Filter spam and inappropriate content - spam-prevention

in a web application how is spam and inappropriate content filtered ... spam probably captcha and what abt inappropriate content, vulgarities etc?

With inappropriate content, you need to have a reference list of words you don't want to see. You can then flag / filter content based on your list. You can add to the list over time with words and phrases that have "got through".
As with all solutions, if you prevent people putting the word "hello", then they will inevitably start putting "h e l l o" or "hell0" or other variations, which are harder to detect.
The best way to catch them all is to supply a "flag inappropriate content" flag so humans can notify you of anything offensive.

You could also use a service such as Aksimet.

Related

Is there a way to hide just the prop type errors that come in developer console - not all the errors

As part of a really large React codebase, we have added a lot of prop type check over the years.
They output a lot of errors when prop type validations fail:
I noticed that in the developer console, I can override the default settings to hide all the errors like below:
and if I do that all the normal errors and these type invalidation errors get hidden.
Is there a way I can hide only the prop-type check errors (by classifying them as some other output type) and keep getting the usual JS errors - to reduce the noise I'm getting and this also causes a lot of vertical scroll which is hard to keep up with and causes the usual console messages to lose sight of.
Solution
you can use filter field provided in developer console
you can filter out error based on their content using regex, simply write -/Failed\s+prop\s+type/ in the filter field.
Explanation
we write regex in between // , we append it with - to indicate that don't show anything that matches the regex, \s+ is used to represent whitespace in regex.

Excel: apply conditional formatting if cell contains one of x strings

What I'm trying to do should be quite simple but I am getting error messages saying that conditional formatting doesn't accept this method.
So I am looking for a fix or an alternative.
What I have is a list of search texts for phone faults
screen broken
wifi not working
bluetooth dead
the dooflip isnt working
etc.
I have also set up a number of common keywords
screen
wifi
bluetooth
By comparing these two we can see that the last one doesn't adhere to any of my common keywords, and so I want it highlighted/ copied somewhere etc. so I can view and take any action.
So far I have attempted to set up conditional formatting to search the terms for the keywords and if it doesn't contain any then highlight it.
=ISERROR(SEARCH({"wifi", "bluetooth", "screen"},$H$117))
When using this I get informed that conditional formatting does not support arrays (it works fine if I only specify one search term).
If i create a table with all the keywords in and use the following it works, however it will only find direct mataches, and wont search for the word in the cell string
=ISERROR(MATCH(<cell_to_change_colour_of>, <keyword_table>,0))
So is there another way of doing this?
my answer requires MOREFUNC addon*
=REGEX.COMP(A1,"wifi|bluetooth|screen",FALSE)
this will return true if any of the words appear anywhere in cell A1. FALSE in the formula stipulates that it is not case sensitive.
Unfortunately due to Excell's stupid rules it will not work directly in Conditional Formatting box. You will need to place it in a helper column, and point the conditional formatting rule to that column.
MOREFUNC ADDON
Morefunc Addon is a free library of 66 new worksheet functions.
HERE is some information (by original author)
here is the last working download link I found
here is a good installation walk-through video

How to tag text, to keep track of unique edits

So, for example in database I have three users: Peter, John and Sara. There is a specific field, in which all three users can write.
Peter writes:
"I like apples"
, after that John appends with
" and I like bananas"
. Now I have field which says
"I like apples and I like bananas"
, so If I would like to display, which part was writen by whom, my approuch would be to create html tags:
The field would be:
<span class="text-sequence-1">I like apples</span><span class="text-sequence-2"> and I like bananas</span>
and then, from database I would pick the sentences by its order and using CSS on hover on display additional content, on each part of hover on.
1st problem. The problem is if, the third user, Sara, comes and
updates the text, which belongs to both original. Which can be
overcome if I allow to edit one by one Johns and Peters tags.
Then I get edited span inside of original spans and could track
which part was edited and how. If I did like this, I would still
face a second problem:
2nd problem. If Sara decides to edit, for example Johns part, a few
times. I would still get nested badly.
I could use something like #number tags instead of spans, so I can track where each edition ends, but then I couldn't apply CSS code to them to color which part belongs to who and apply additional effects on hover, like showing a box, who edited it and when.
Any ideas how could I implement it?
Sorry for my bad english.
Since you are using a database, keep track of the edits in a separate table. For each edit, keep the following fields:
row-ID of this edit (primary key)
the parent row-ID (the row-ID of the "current edit" when the edit was started/confirmed; see below for how to use)
the author that edited things
the time-stamp
an optional short text describing what was changed (for example, "fixed spelling")
When showing the field, you can then display a link to a "history", that would show who edited what when. You can show individual differences between any two versions such as Wikipedia does when you look at the history of a page - there are many libraries to do that, with highlighting and all. This library seems nice, but there are many others, in all sorts of languages.
When someone starts to edit, let them modify the then-current version (highest time-stamp). When they commit their edit (click accept or similar), check again to see that nobody else has changed things while they were editing (the time-stamp of the parent edit is still highest). If someone did change something, show them the difference between your parent-row and the edit, and tell them to fix things before committing (there may be several edits to take into account). This is the "wikipedia way", and it amounts to a sort of lightweight version control (much easier to implement than, say, Git)
Acually I think that this approach is not good. As you noticed you will get alot of nasty nestings.
What if somone edits only one letter?
Instead of that, think about line comparison approach. Like Git does. So compare if first line changed and store each version.( More sophisticated way would be only storing lines that changed and applying changes like git patches.)
I think your way is destined to fail. It's far way too complex and there is no logical comparision method to be used.
John is cool
John is uncool
John is Uncool
John is weak
Think how you would tag those. What if somone deletes piece of text? Edit will not be visible or u will insert an empty tag (which will not be visible)?
Dont tag, compare. Tagging is not what you're looking for i think. Also please see: Text comparison algorithm

Do not allow ".xml"/".html"/"index" in URI?

I'm going through Lift's basics in Section 3.2 SiteMap of Simply Lift and one thing struck me.
Using the default SiteMap code, you can ask for, say, info view in three ways:
GET /info,
GET /info.html,
GET /info.xml (why?).
What is more, you can request index view in four different ways:
GET /,
GET /index,
GET /index.html,
GET /index.xml.
How can I limit this behaviour to GET / for directories and GET /info for files?
P.S. All of these return 200 OK:
foursquare.com/,
foursquare.com/index,
foursquare.com/index.html,
foursquare.com/index.xml.
Shouldn't one resource have one URL only?
There are actually more than four ways that it can be parsed. The full list of known suffixes (any of which can be used to access the page) can be found here.
I think the reason for that is that lift can be used to serve any resource, so most are explicitly added by default.
I think you could disable Lift's processing of all extensions by adding this to Boot.scala:
LiftRules.explicitlyParsedSuffixes = Nil
However, I wouldn't recommend that as there may be some side-effects.
Using Req with RestHelper you can specify the suffix explicitly, but I don't know if there is such a construct to do so with Sitemap.
Actually, the code to determine whether Lift should handle the request or not is here. You can see the default extensions in the liftHandled method directly above, but they can all be overridden with LiftRules.liftRequest. Something like:
LiftRules.liftRequest append {
case r => Full(r.path.suffix.trim == "")
}
Should do the trick.
As far as why it works that way, Jason is right that Lift is designed to handle multiple types of dynamic resource.

WinForms name chooser

I have a set of names (first, last, salutation) and need a control to allow users to select a single name using WinForms. A ComboBox works fine if the there are ~20 names, but not so well when there are >100 names.
Can anyone recommend a name picker? Perhaps an address book control that I could customize? It's not too hard to write my own, but I have other wheels to invent.
I'm giving you an answer that seems more like a feature request... :-) It can be very easy to use if you implement a control which behaviour is similar to the auto-completion feature of Google: foreach char inserted by the user, a window appears with only the names that match with the string inserted.
I think that it isn't so hard to implement, but I'm sorry, I can't give you a recommendation, only an advice :-)
I agree with Maurizio. To add to his answer:
The most commonly used interface which does exactly this is in email clients, where they auto-complete names (and/or email addresses) as you type them. Thunderbird is a pretty good example. These usually either auto-complete if there is only one match, or show a drop-down list of possible autocompletions you can pick from. In addition, a button next to the field usually allows you to browse the address book as a list.
I'd also suggest filtering the autocompletions available in the most useful ways: e.g. As you type "wi", you could filter it down to names like "[WI]lson, John", "Amery, [WI]lliam", and "[I]ving, [W]alter", making it easy to find people by their initials as well as first and surnames.

Resources