Questions tagged [policy]

Best practice and style are at the core of every program; there is always a better way to do something. Policy helps programmers determine how something should be written.

Policy is a more or less ambiguous way of describing the best way to do something in programming. This can often be described as "best practice" when writing a program. This can pertain to the way a method returns a value, the way inheritance is structured, and the way to exit a loop, among other things, and it can vary from language to language.

You can learn more about policy and programming paradigm here.

1065 questions
165
votes
32 answers

Is there a valid reason for enforcing a maximum width of 80 characters in a code file, this day and age?

Seriously. On a 22" monitor, it only covers maybe a quarter of the screen. I need some ammo to axe down this rule. I'm not saying that there shouldn't be a limit; I'm just saying, 80 characters is very small.
TraumaPony
  • 10,573
  • 12
  • 52
  • 72
125
votes
23 answers

Is there an S3 policy for limiting access to only see/access one bucket?

I have a simple bucket that looks like images.mysite.com on my S3 and other buckets containing backups, etc. I want to allow a specific user to be able to access the images.mysite.com bucket in order to upload images. However, I DO NOT want him to…
Alex
  • 4,057
  • 5
  • 26
  • 45
83
votes
10 answers

How to disable Google asking permission to regularly check installed apps on my phone?

I'm developing an Android app, which I therefore endlessly build and install on my test device. Since a couple days I get with every build/install a question asking Google may regularly check installed apps for potentially harmfull behaviour.…
kramer65
  • 39,074
  • 90
  • 255
  • 436
82
votes
2 answers

How long should I wait after applying an AWS IAM policy before it is valid?

I'm adding and removing AWS IAM user policies programmatically, and I'm getting inconsistent results from the application of those policies. For example, this may or may not succeed (I'm using the Java 1.6.6 SDK): Start with a user that can read…
79
votes
1 answer

What parameters are allowed in Desktop web game policy change?

We have a browser based game which uses Facebook Connect through an AppID that we used to run the same game in a canvas until Fb Credits were introduced and we were forced to shut it down. Now, we only use the App the same way as a product page with…
Christopher Lörken
  • 2,582
  • 16
  • 17
60
votes
6 answers

AWS Lambda:The provided execution role does not have permissions to call DescribeNetworkInterfaces on EC2

Today I have a new AWS Lambda question, and can't find anywhere in Google. I new a Lambda function, there is no question. But when I input any code in this function[eg. console.log();] and click "Save", error is occured: "The provided execution…
fisheep
  • 929
  • 1
  • 10
  • 14
48
votes
5 answers

iOS recurring subscription policy for service, not content

Apologies in advance for a policy, rather than a programming question, but given the paucity of information available online I hope I can be forgiven for asking it here. I would like to use the new recurring subscriptions from Apple in an iOS app. I…
Roger
  • 15,683
  • 3
  • 49
  • 73
47
votes
1 answer

URL for public Amazon S3 bucket

I have an Amazon S3 bucket that I make public with a policy like this { "Version": "2012-10-17", "Statement": [ { "Sid": "Allow Public Access to All Objects", "Effect": "Allow", "Principal": "*", …
Gene Vincent
  • 4,721
  • 7
  • 43
  • 82
36
votes
8 answers

Warning of Google Play Developer policy violation: Action Required

I recently received many mails from google for many of my apps. The email content is: Hello Google Play Developer, Our records show that your app, XXXX, with package name com.XXXX.XXXXXXXXXX, currently violates our User Data policy regarding …
ysnsyhn
  • 457
  • 1
  • 6
  • 11
33
votes
2 answers

Amazon S3 files access policy based on IP Address

Is there any way to limit the access of a file stored in Amazon S3 based on the client IP address? I have a file stored there, which should be access only by specific IP address. How to do this?
Daniel Cukier
  • 10,639
  • 12
  • 61
  • 115
30
votes
3 answers

Laravel: Difference Between Route Middleware and Policy

Developing an app with laravel I realised that what can be done with Policy can exactly be done with Middleware. Say I want to prevent a user from updating a route if he/she is not the owner of the information, I can easily check from the route and…
James Okpe George
  • 3,047
  • 7
  • 42
  • 76
30
votes
1 answer

Difference between specification and a policy?

I am reading the brilliant book "Domain Driven Design" written by Eric Evans. In his book Eric describes two different concepts: the specification pattern and policies. Here is an example for a specification: public interface ProjectSpecification…
MUG4N
  • 18,011
  • 10
  • 52
  • 81
24
votes
3 answers

Restricting S3 bucket access to a VPC

I am trying to apply the following policy in order to restrict my_bucket's access to a particular VPC. When I try apply this as a bucket policy, I get an Policy has an invalid condition key - ec2:Vpc. How do I correct this? { …
Lelouch Lamperouge
  • 7,227
  • 7
  • 38
  • 57
22
votes
1 answer

Limiting file access in Java

Problem: In my Java application (not an applet) I wish to limit certain file operations to all classes except a list/group/package of classes that should not be restricted. Specifically, I would like to limit... File reads File writes File…
obfuscation
  • 1,023
  • 2
  • 16
  • 22
22
votes
5 answers

Why is there no synchronous WebSocket support in Web Workers when there is synchronous FileSystem support?

I understand why browser vendors don't want to help me block their UI thread. However, I don't understand why there is: no sleep(2) in Web Workers no synchronous WebSockets API There is a synchronous FileSystem API. There is also a synchronous…
Janus Troelsen
  • 17,537
  • 13
  • 121
  • 177
1
2 3
70 71