conventions

What is the relationship between java:comp/env and java:global?

此生再无相见时 提交于 2019-11-28 16:20:13
问题 What is the relationship between java:comp/env and java:global (regarding 3.1 spec)? Seems like java:comp/env contains specific to EJB references. What means "specific" in this case? 回答1: java:global is a namespace that's global for the entire application server, which includes other EAR modules (which are considered to be different applications). java:comp/env is a much smaller namespace. For the web module, it corresponds to all web components (servlets etc) which are all together

Objective-C: Assertion vs. Exception vs. Error

好久不见. 提交于 2019-11-28 15:13:17
In Cocoa, when should I use NSAssert, NSException, NSError? Here's what I've been thinking: NSAssert - When creating any client program used for the programmers own benefit to double check rules, conventions, assumptions, or pre-conditions and post-conditions? NSException - When creating a third-party library for the benefit of other programmers that use the library, so that they immediately know when an input is invalid? NSError - When interfacing with an external system to get data like a file, database, or web service that isn't guaranteed to give me a result? An NSAssert will throw an

Where to define custom error types in Ruby and/or Rails?

心已入冬 提交于 2019-11-28 15:12:01
Is there a best practice for defining custom error types in a Ruby library (gem) or Ruby on Rails application? Specifically: Where do they belong structurally in the project? A separate file, inlined with the relevant module/class definition, somewhere else? Are there any conventions that establish when to and when not to create a new error type? Different libraries have different ways of doing things, and I haven't noticed any real patterns. Some libraries always use custom error types while others don't use them at all; some have all errors extending StandardError while others have nested

What is trunk, branch and tag in Subversion? [duplicate]

若如初见. 提交于 2019-11-28 14:57:19
Possible Duplicate: What do “branch”, “tag” and “trunk” really mean? What is a trunk, branch and tag in Subversion and what are the best practices to use them? What tools can I use for Subversion in Visual Studio 2008 ? David Schmitt The trunk is the main line of development in a SVN repository. A branch is a side-line of development created to make larger, experimental or disrupting work without annoying users of the trunk version. Also, branches can be used to create development lines for multiple versions of the same product, like having a place to backport bugfixes into a stable release.

What does it mean when a css property starts with a dash? [duplicate]

此生再无相见时 提交于 2019-11-28 11:36:47
This question already has an answer here: Why do browsers create vendor prefixes for CSS properties? 2 answers I just downloaded a css file from this website and it contains properties such as -webkit-transform and -moz-transform . What does the dash mean and under what circumstances is it required? For the nity grity does the phrase "vendor prefix" refer to the - or the content between the - and - (exuding the - and -) or the content between the - and - (including the - themselves)? In other words does vender prefix refer to the dash itself or only the content between the dashes or the dashes

Is there a specific order that HTTP tag attributes should be listed in?

痞子三分冷 提交于 2019-11-28 07:56:58
问题 Should the attributes of any particular HTML tag be listed in a specific order? Is there a convention for the order? For example, I have the following image tag in an HTML strict page... <img src="http://example.com/media/graphics/border_bottom.png" class="border" height="5px" width="600px" alt="Lower Border" /> Should the src be listed first, or the height, or the width, etc? What is the proper order? Thanks in advance! 回答1: No there isn't, but anyway you should follow make your own standard

Private and protected methods in Objective-C

馋奶兔 提交于 2019-11-28 07:52:27
What is the recommended way to define private and protected methods in Objective-C? One website suggested using categories in the implementation file for private methods, another suggested trailing underscores, or XX_ where XX is some project-specific code. What does Apple itself use? And what about protected methods? One solution I read was to use categories in separate files, for example CLASS_protected.h and CLASS_protected.m but this seems like it could get very bloated. What should I do? There are three issues: Hiding from compiler. That is, making it impossible for someone else to

Java array convention: String[] args vs. String args[]

旧时模样 提交于 2019-11-28 06:52:27
I am currently teaching students as a tutor programming conventions. I've told them that they can find most conventions in the Oracle Code Conventions . In my last tutorial a student asked if: public static void main(String args[]) or public static void main(String[] args) is written by convention or if there is a difference. I have never seen the first version before, so I'm very sure that the second one is a convention. But I don't have a source for that. Can you give me a source (preferably from oracle, like the page I've linked above) that makes clear which of both is convention?

Do people use the Hungarian Naming Conventions in the real world? [closed]

╄→гoц情女王★ 提交于 2019-11-28 06:46:07
Is it worth learning the convention or is it a bane to readability and maintainability? Considering that most people that use Hungarian Notation is following the misunderstood version of it, I'd say it's pretty pointless. If you want to use the original definition of it, it might make more sense, but other than that it is mostly syntactic sugar. If you read the Wikipedia article on the subject, you'll find two conflicting notations, Systems Hungarian Notation and Apps Hungarian Notation . The original, good, definition is the Apps Hungarian Notation , but most people use the Systems Hungarian

Why would font names need quotes?

ぃ、小莉子 提交于 2019-11-28 05:45:52
As far as I know, one needs to use double or single quotes for fonts if they contain spaces, like: font-family: "Times New Roman", Times; font-family: 'Times New Roman', Times; But on Google Fonts ( http://www.google.com/webfont ), I also see font-family: 'Margarine', cursive; Some even use it like so: font-family: 'Margarine', 'Helvetica', arial; I find this weird, as the following works as well: font-family: Arial, Helvetica, sans-serif; font-family: Cambria, serif; So what is the correct usage of quotes around font names in CSS? Jukka K. Korpela You can always put a specific font family