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.

646 questions
457
votes
21 answers

What does the 'static' keyword do in a class?

To be specific, I was trying this code: package hello; public class Hello { Clock clock = new Clock(); public static void main(String args[]) { clock.sayTime(); } } But it gave the error Cannot access non-static field in…
Click Upvote
  • 235,452
  • 251
  • 553
  • 736
66
votes
2 answers

Add attributes to a simpletype or restriction to a complextype in Xml Schema

The problem is as follows: I have the following XML snippet: The problem is that I can't add both the attribute and the restriction at the same time. The attribute format can only have the values minutes, hours…
Ikke
  • 90,705
  • 23
  • 91
  • 118
51
votes
3 answers

How to achieve "not in" by using Restrictions and criteria in Hibernate?

I have list of category. I need a list of category by excluding 2,3 row. Can we achieve through hibernate by using Criteria and Restriction?
Shashi
  • 11,342
  • 16
  • 60
  • 108
33
votes
1 answer

Is the per-host connection limit raised with HTTP/2?

Browsers have a per-host limit regarding number of parallel XHR (about 6 nowadays). Does this restriction apply to multiplexed HTTP/2 connections?
Warren Seine
  • 1,983
  • 1
  • 21
  • 36
30
votes
5 answers

Why I can't extend bool in Python?

>>> class BOOL(bool): ... print "why?" ... why? Traceback (most recent call last): File "", line 1, in TypeError: Error when calling the metaclass bases type 'bool' is not an acceptable base type I thought Python trusted…
Juanjo Conti
  • 25,163
  • 37
  • 101
  • 128
26
votes
6 answers

How to limit user commands in Linux

I have a user in a group: "demo". I want to set the policy that this user can run only 10 commands, like vim, nano, cd, etc. Or, set the policy to have access on all commands except ssh and cat commands.
mortymacs
  • 2,657
  • 2
  • 22
  • 42
25
votes
3 answers

Rails: Restrict API requests to JSON format

I would like to restrict requests to all API controllers to being redirected to the JSON path. I would like to use a redirect since also the URL should change according to the response. One option would be to use a before_filter which redirects the…
JJD
  • 44,755
  • 49
  • 183
  • 309
25
votes
4 answers

Inconsistent accessibility: field type 'world' is less accessible than field 'frmSplashScreen

I have this error called Inconsistent accessibility: field type 'world' is less accessible than field 'frmSplashScreen' In my code there is a public partial class called frmSplashScreen There is also a public class called world The line that…
user1761786
  • 271
  • 1
  • 3
  • 6
22
votes
5 answers

How to restrict a column value in SQLite / MySQL

I would like to restrict a column value in a SQL table. For example, the column values can only be "car" or "bike" or "van". My question is how do you achieve this in SQL, and is it a good idea to do this on the DB side or should I let the…
Maro
  • 3,915
  • 7
  • 31
  • 34
22
votes
2 answers

XSD Restriction on Attribute

I think I have searched a lot about this but still no go. Will appreciate any help. I am trying to restrict an attribute for an element with empty content. "color" should have a restriction to only hold 3 digit or minLength=3 and maxLength=3. It…
ZiggyStardust
  • 335
  • 1
  • 4
  • 15
20
votes
5 answers

readonly-fields as targets from subclass constructors

A readonly field should be used when you have a variable that will be known at object-instatiation which should not be changed afterwards. However one is not allowed to assign readonly fields from constructors of subclasses. This doesn't even work…
15
votes
2 answers

Restricting IP addresses for Jetty and Solr

I'm setting up Solr using Jetty. I would like to restrict access to only a few IP addresses. It doesn't seem immediately obvious that this can be done using Jetty. Is it possible and if so, how?
Lyndsay
  • 233
  • 1
  • 2
  • 9
14
votes
1 answer

IP restriction with htaccess

I want to restrict an entire site in such a way that just two IPs could enter the site. I have the following in my .htaccess (at the root of site): ErrorDocument 403 http://www.example.com/views/error403.html Order Deny,Allow Deny from all Allow…
ARemesal
  • 2,793
  • 5
  • 22
  • 23
14
votes
6 answers

Restricting parent class members to its immediate child class only

Suppose I have four classes in java with given hierarchy. class A {} class B extends A {} class C extends B {} class D extends C {} As per my understanding all the accessible fields of class A will be available to all its child classes through…
user8001621
  • 149
  • 5
14
votes
4 answers

Using mysqlimport where the filename is different from the table name

I've been playing with mysqlimport and I've run into the restriction where the filename has to be the same as the table name. Is there any way to work round this? I can't rename the file as it is used by other processes and I don't want to copy the…
Mike Q
  • 21,350
  • 19
  • 80
  • 124
1
2 3
43 44