There are a number of plugins for Hudson to create coverage, test result, metrics and other reports.
It seems that all of them require you to add extra configuration to your build scripts (or Maven POM) for every project that you want to have the reporting done. For example, if you want to have a FindBugs or a Cobertura report, you need...
The suggested pattern for processing a form in a view seems overly complex and non-DRY to me:
def contact(request):
if request.method == 'POST': # If the form has been submitted...
form = ContactForm(request.POST) # A form bound to the POST data
if form.is_valid(): # All validation rules pass
# Process th...
I have the following identical code-block in all my controllers' beforeInterceptor blocks:
def beforeInterceptor = {
request.someField = Foo.someFoo(request)
if (!request.someField) {
redirect(...)
return
}
}
Repeating the exact same code fragment in all controllers violates DRY. Is there some standard Grails way to defi...
I have a model class that has, among other things:
class Group < ActiveRecord::Base
has_many :subscriptions
has_many :users, :through => :subscriptions
has_many :admins, :through => :subscriptions, :source => :user, :conditions => "subscriptions.role = #{ROLES[:admin]}"
has_many :subscribers, :through => :subscriptions, :source...
I read this article today http://dotnetslackers.com/articles/silverlight/Silverlight-3-and-the-Data-Form-Control-part-I.aspx about the use of the MVVM pattern within a silverlight app where you have your domain entities and view spesific entities which basically is a subset of the real entity objects. Isn't this a clear violation of the ...
What can I do to share code among views in CouchDB?
Example 1 -- utility methods
Jesse Hallett has some good utility methods, including
function dot(attr) {
return function(obj) {
return obj[attr];
}
}
Array.prototype.map = function(func) {
var i, r = [],
for (i = 0; i < this.length; i += 1) {
r[i] = func(this[i]);
...
I'm coming from Ruby to Objective-C and I keep doing:
NSObject *foo;
@property (nonatomic,retain) NSObject *foo;
in the .h file, and then in .m file:
@synthesize foo;
at the top and
[foo release]
in dealloc.
It's 4 steps to add foo! Do seasoned Objective-C programmers do all four steps manually each and every time they want t...
I'm having a hard time building a Cairngorm Flex3 app that connects to a rails app...
I'm used to rails DRY approad, and the Convention over Configuration thing too.. and Cairngorm in awful at these.
How do you keep you flex code as DRY as possible?
I've implemented a generic delegate to avoid a delegate for each command, at least.
Any...
This is a snippet of code from an update method in my application. The method is POSTed an array of user id's in params[:assigned_ users_ list_ id]
The idea is to synchronise the DB associations entries with the ones that were just submitted, by removing the right ones (those that exist in the DB but not the list) and adding the right o...
Probably simple question and I'm just missing something, but I'm stuck out of ideas.
I have Django project serving several sites with distinct sessions.py and completely different ROOT_URLCONFs. One site handles user registration, authentication and profile settings, other site (on another domain) acts as file manager and so on. Sites a...
Here's my problem: We have N applications running in M different environments (qa/prod/etc.) with P servers per environment. Multiplied out, the number of unique configurations is in the hundreds. Each of these applications has a set of environment-specific properties (public hostname, listening port, max memory, etc.).
Multiplied ou...
I'm coding some web-applications in MVC, and I have a problem with something that has been on my mind for a time. The web-aplications I'm developing are mostly going to be used in Swedish, and because of the language I want to have my URL routing mapped against Swedish URL names.
mysite.com/products/details/1
(English URL)
mysite.com/...
I'm having a problem with the DRY principle (Don't Repeat Yourself) and minimizing dependencies that revolves around Rete rules engines.
Rules engines in large IT organizations tend to be Enterprise (note the capital "E" - that's serious business). All rules must be expressed once, nice and DRY, and centralized in an expensive rules en...
'Ello, all. I'm trying to create a model in Django based on - but not subclassing or having a DB relation to - another model. My original model looks something like this: it stores some data with a date/time stamp.
class Entry(Model):
data1 = FloatField()
data2 = FloatField()
entered = DateTimeField()
I'd also like ...
One of the new features in ASP.NET MVC 2 Preview 1 is support for the concept of Editor Templates and Display Templates which allow you to pre-define how a given object will be rendered for display or editing with a simple HTML helper call:
<%=Html.EditorFor(customer => customer) %>
<%=Html.DisplayFor(customer => customer) %>
This is ...
Hello everyone,
I have a Rails application with several models-views-controllers which have some similar characteristics, for example 5 different models can be commented on, voted on or tagged, I am also heavily using external plugins.
At the moment I introduced comments, votes, tags, etc. only to a single model (and its view and cont...
In XSLT, what is the preferred way to keep code DRY when it comes to 'if's?
At the moment I am doing this:
<xsl:if test="select/some/long/path">
<element>
<xsl:value-of select="select/some/long/path" />
</element>
</xsl:if>
I would prefer to only write "select/some/long/path" once.
...
While striving for const-correctness, I often find myself writing code such as this
class Bar;
class Foo {
public:
const Bar* bar() const { /* code that gets a Bar somewhere */ }
Bar* bar() {
return const_cast< Bar* >(
static_cast< const Foo* >(this)->bar());
}
};
for lots of methods like bar(). Writing these non-con...
I have a few modules with some functionality overlap. In accordance with DRY, I'd like to move this out to another location, so I will have less code to maintain. Where is the best place to do this? If I just make a module (and make it a dependency of the ones that need it), will I be guaranteed that the constants, functions and variable...
I have been working on a project that requires a bar graph to be populated with price results. The chart displays the number of items within a given price range. For instance, if on amazon there are 9 items within the price range of $0-$10 the x-axis would display $0-$10 and the y-axis would be populated with a value of 9.
My bar graph...