Questions tagged [restriction]

A restriction is anything that constrains or limits the code in some fashion.

Restriction is a very broad tag that denotes a requirement to restrict the code in some fashion.

706 questions
9
votes
8 answers

Is there a way to jail in Javascript, so that the DOM isn't visible

I would really like to provide the user some scripting capabilities, while not giving it access to the more powerful features, like altering the DOM. That is, all input/output is tunneled thru a given interface. Like a kind of restricted…
TiansHUo
  • 8,509
  • 7
  • 45
  • 57
8
votes
1 answer

Using .htaccess to restrict access to files

I have 2 domains hosted on the same account but I want to restrict the second one to not access files. I have abc123.com and zyx987.com. In my php I do everything I need to display the domain name and template based on the domain but I want only the…
Owan
  • 205
  • 1
  • 7
8
votes
11 answers

How can we restrict the user from saving a web page?

How can we restrict a user from saving the page? Please provide some tips to disable File->Save and View Source options EDIT: Obviously it can't be done, and probably shouldn't be attempted. But possibly a more interesting variant on this question…
vikrant
8
votes
2 answers

R: Force regression coefficients to add up to 1

I'm trying to run a simple OLS regression with a restriction that the sum of the coefficients of two variables add up to 1. I want: Y = α + β1 * x1 + β2 * x2 + β3 * x3, where β1 + β2 = 1 I have found how to make a relation between coefficients…
Daniel
  • 639
  • 8
  • 24
8
votes
3 answers

What rules apply to naming a mysql column?

In a MySQL table, naming a column, can I use spaces uppercase letters UTF8 characters What other rules shall I follow? ( MySQL5 )
István Pálinkás
  • 2,217
  • 7
  • 25
  • 50
8
votes
1 answer

OWL restrictions - defining classes that only contains properties with a specific property value

I'm currently playing a bit with the OWL and especially with restrictions. I'm trying to create a query that does the following: Suppose that I have a class 'Cinema' that has a property 'movies' (that contains objects of type 'Movie'). The class…
Devos50
  • 2,025
  • 4
  • 25
  • 56
8
votes
1 answer

How can I add a restriction to a complextype in XML (XSD) schema?

Can anyone help me to add a restriction to this schema file (for OwnerEnglishName)? I know how to do it with a simpletype, while in a complextype I don't know how to do it. Can anyone help? Thanks a lot. Original XML:
Q8Y
  • 3,801
  • 12
  • 39
  • 38
7
votes
3 answers

JSF and PrettyFaces - How to restrict direct xhtml requests

I'm new to JSF and PrettyFaces. So by now i found out that i can configure PrettyFaces to "forward" the request to the right .xhtml file. The problem is, that i (or a user, in case he knows my folder structure) also can request the file. This is my…
Alebon
  • 1,189
  • 2
  • 11
  • 24
7
votes
1 answer

In Rust, how can I restrict a generic T to allow modulus?

As an exercism exercise, I'm currently trying to filter an iterator according to whether the value is even in order to produce a new iterator. My function currently looks like: pub fn evens(iter: impl Iterator) -> impl Iterator
Brian Kessler
  • 2,187
  • 6
  • 28
  • 58
7
votes
5 answers

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…
Emil
  • 71
  • 2
7
votes
2 answers

XSD: How to restrict enumeration values of a derived complex type?

Given the following example:
tobsen
  • 5,328
  • 3
  • 34
  • 51
7
votes
3 answers

Is there a way to specify the where T:new() restriction but with internal constructor?

I've created a generic class that needs to instantiate its implementation type, so the implementation type has to have an accessible parameter less constructor. Looks like the new() restriction could do the job but its enforcing the implementation…
Ignacio Soler Garcia
  • 21,122
  • 31
  • 128
  • 207
6
votes
4 answers

Is there any way to block a C# plugin from accessing the main C# Application in a program?

I have a program and a simple plugin architecture where the plugins implement a generic interface and the main program loads all plugins that implement this interface. It's the most common custom plugin architecture I have found so far, so that's…
Mike Webb
  • 8,855
  • 18
  • 78
  • 111
6
votes
4 answers

Generic Restriction Hell: Bound Mismatch

I'm working on a project that has an extensive tree of generic inheritance and dependencies. Go to edit to see better example. The basics look something like this: class A { ... } class B { ... } class C extends B { ... } class D
unholysampler
  • 17,141
  • 7
  • 47
  • 64
6
votes
4 answers

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…
Mark
  • 9,320
  • 6
  • 57
  • 70
1 2
3
46 47