restriction

WCF: limit number of calls per hour - per user

Hi guys, I've got a WCF service (basicHttpBinding, basic authentication, IIS 6.0) on which I want to restrict the number of calls per hour - on user basis. For example, max 1000 calls per user, per hour (a la Google Maps, etc). I also want to implement some sort of subscription mechanism, so that users can upgrade their call-limit ac...

Excluding a folder from autotesting

I've just installed a ZenTest to use autotest in my project. I use rspec and have an integration folder inside it. As I don't want all my integration tests run every single time I start autospec , so I'd like to somehow restrict autospec from running tests in that folder. How do I exclude a chosen folder inside a /spec from running by a...

Is it possible to restrict instantiation of an object to only one other (parent) object in VB.NET?

VB 2008 .NET 3.5 Suppose we have two classes, Order and OrderItem, that represent some type of online ordering system. OrderItem represents a single line item in an Order. One Order can contain multiple OrderItems, in the form of a List(of OrderItem). Public Class Order Public Property MyOrderItems() as List(of OrderItem) End...

Visual Studio 2010 C# .NET textbox restrictions

if user entered "!" "?" "," in textbox and press button, this person see ERROR message in label. how can make that? and what is the code? ...

wordpress backend: retrict post tags to site tags only

In the post screen, I want to remove the option of multi-authors being able to 'free tag' their posts. In other words, only allow tags that have been preset in the admin tags section.(these tags are of course visible in the tag cloud in posts screen) The concept is to prevent authors introducing random tags in their posts, leading to dup...

PHP5: restrict access to function to certain classes

Is there a way in PHP5 to only allow a certain class or set of classes to call a particular function? For example, let's say I have three classes ("Foo", "Bar", and "Baz"), all with similarly-named methods, and I want Bar to be able to call Foo::foo() but deny Baz the ability to make that call: class Foo { static function foo() { pr...

How does one avoid "Value restriction" errors with F#'s Seq.cast?

I see that Seq has a cast function from IEnumerable to Seq, but how do I get it to work? open System.Text.RegularExpressions;; let v = Regex.Match("abcd", "(ab)");; Seq.cast (v.Captures);; This produces, error FS0030: Value restriction. The value 'it' has been inferred to have generic type val it : seq<'_a> Either define 'it' as ...

Calculating number of users accessing my website at a specific point of time

Hi... I am having a web application built using ASP and Asp.Net.I want to restrict number of users accessing this website.There are ways available separately ASP and ASP.NEt but,not for combination of these two. MayI know if I could just use Application["somename"] in global.asax One more thing is when a user leaves the application, whi...

problem in filtering textbox in windows application

My requirment is i want to enter decimal value in my textbox ,In case if the user entered the .dot he must enter 3 decimal value other wise it should not allow to leave textbox.if te user not entered .dot he may allow to enter any no of digit how to restrict this in .net winforms textbox. decimal((1-9),3) Before the decimal place it ma...

How to constrain Xml content to a specific length using xsd restrictions?

Using XSD, is it possible to constrain the total text within a Node. In the example below, I want Address Node content to be restricted to 255 characters. <Address> <Line1>Text</Line1> <Line2>Text</Line2> <City></City> <Street></Street> <State></State> <Country></Country> </Address> So, if I only had Line1 and...

XSD Problem: How to only restrict an element/attribute to be used under another schema

I need to solve this and looks like I need help. Here is the problem definition We have an existing schema X [X is an industry standard schema] for which we are building some extensions in a new schema Y (with a different target namespace]. Now the problem is we want to restrict usage of the elements/attributes of Schema Y to be onl...

how to restrict user not to vote an article more than once?

in my application a user can post his/her article that other users can response upon ans vote up and down also like stackoverflow has for posted question ans answers. How can I restrict user so that he/she can't vote twice ? ...

Hibernate Criteria, Joins, Or

I'm trying to accomplish ad-hoc queries using joined tables, using an Restrictions.or and Restrictions.ilike My entities look like: @Entity @Table(name="CASE_REVIEW") public class CaseReview { @Id @Column(name = "REVIEW_ID", unique = true, nullable = false, length = 19) private Long reviewId; @ManyToOne(fetch = FetchT...

an I prevent a specific type using generic restrictions

I have an overload method - the first implementation always returns a single object, the second implementation always returns an enumeration. I'd like to make the methods generic and overloaded, and restrict the compiler from attempting to bind to the non-enumeration method when the generic type is enumerable... class Cache { T Get...

Restrict what can create a PHP Class

I got two classes, "A" and "B". In the application logic no one is allowed to create an object of class "B", except for class "A". But, since I dont want to have the two classes in the same file I cant restrict it with the "private" properity. Is it possible to create this kind of restriction? If someone other then "A" tries to create...