I have a lot of code like the following, where I explicitly implement some events required by an interface.
public class IMicrowaveNotifier {
event EventHandler<EventArgs> DoorClosed;
event EventHandler<EventArgs> LightbulbOn;
// ...
}
public class Microwave : IMicrowaveNotifier {
private EventHandler<EventArgs> _doorClosed;
...
Is anybody out there using Project Lombok for a large scale production system? How does it influence your compile process (i.e. does it do two-pass compilation, slow it down, make it more fragile)?
...
I'm working on a project where there are two sets of XML schema-generated objects which are two entirely different sets of classes with a similar structure. Conversion between the the two sets consists of a huge amount of boilerplate redundant coding (such as converting elements withing several nested layers of collections).
I'm interes...
My project has many reader and writer classes. I started implementing IDisposable, but I believe that it adds many boilerplate code to my classes. For each of the classes, I need to implement:
A destructor.
A Dispose() method.
A Dispose(bool disposing) method.
A "bool disposed" field.
A check to see if the object is already disposed on...
So I'm writing a game in Haskell, and I'm expressing a player's turn as a series of state-altering functions that correlate to various turn phases. Originally, this looks something like:
let game' = phase1 game
game'' = phase2 game'
-- etc.
Prime candidate for State monadosity, right? This leads to the more elegant:
do
phase1
...
Has anyone seen metamorphic code -- that is, code that generates and runs instructions (including IL and Java Bytecode, as well as native code) -- used to reduce boilerplate code?
Regardless of the application or language, typically one has some database code to get rows from the database and return a list of objects. Of course, there ...
I've used the Scrap Your Boilerplate and Uniplate libraries in the Haskell programming language, and I would find that form of generic programming over discriminated unions to be really useful. Is there an equivalent library in the f# programming language?
...
Let's say I have the following entity:
public class Store
{
public List<Product> Products { get; set; }
public List<Employee> Employees { get; set; }
public List<Camera> Cameras { get; set; }
}
In other words, a Store that has Products, Employees, and security Cameras. I want to convert this Store to a StoreDTO:
public cl...
Like its style.css has body {background:transparent}
So am i suppose to keep background transparent always to make good html5 website ? Are these default ? Should i override them as per my website ?
...
I have been using cl_mem in some of my OpenCL boilerplate code, but I have been using it through context and not a sharp understanding of what exactly it is. I have been using it as a type for the memory I push on and off the board, which has so far been floats. I tried looking at the OpenCL docs, but cl_mem doesn't show up (does it?). I...
A coworker had never heard of this, and I couldn't provide a real definition. For me, it's always been an instance of 'I-know-it-when-I-see-it'.
Bonus question, who originated the term?
...
I have a Direction Enum:
Public Enum Direction
Left
Right
Top
Bottom
End Enum
And Sometimes I need to get the inverse, so it seems nice to write:
SomeDirection.Inverse()
But I can't put a method on an enum! However, I can add an Extension Method (VS2008+) to it.
In VB, Extension Methods must be inside Modules. I r...