I often need to design a dialog in Delphi/C++Builder that allows various properties of an object to be modified, and the code to use it typically looks like this.
Dialog.Edit1.Text := MyObject.Username;
Dialog.Edit2.Text := MyObject.Password;
// ... many more of the same
if (Dialog.ShowModal = mrOk)
begin
MyObject.Username := Dialog...
Hi all,
How can we create a software package. So that
after extracting our software tar ball user can do
the typical steps:
$ gunzip < mycode.tar.gz | tar xvf -
$ ./configure
$ make
$ make install
...
I have found this list of FOSS licenses. Is there anything similar for non-free/non-open source boilerplate?
Barring that, does anyone known of a commercial software library distributed with a license (that I can "borrow") that fits these requirements:
I retain all rights to software (i.e., it is not freeware or open source).
The dll ...
Hi all,
In a project I'm currently working on, we've added a wrapper class for accessing the HttpSessionState object. The trouble is that the current solution means you have to write some code to wrap the functionality. I came up with the following solution
/// <typeparam name="TKey">Class used for generating key into session state sto...
I have some server side code that needs to check a username/password pair. I'm looking for something to do this that is nice and simple as in having a text file with username/MD5 hash pairs. I'd love the code use to look like this:
if(!PasswordChecker.ValidLogin("passwords.dat", username, password)
throw new Exception("Invalid usern...
Every time I add a new form to my project, it drops a big glop of boilerplate in the uses clause.
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
Seriously, who uses the Variants unit on anything resembling a regular basis? I generally end up removing Windows, Messages, Variants, Graphics ...
What's the minimum boilerplate code required to setup an OpenGL view (with the necessary projections,camera angles etc) for drawing a 2D game?
For example, the minimum required to do Quartz 2D drawing in a custom view (and, say, load a background image) is the following:
#import <Cocoa/Cocoa.h>
@interface MyView : NSView {
}
@end
=...
Possible Duplicate:
Post your extension goodies for C# .Net (codeplex.com/extensionoverflow)
I'm fond of C# 3.0. One of my favorite parts is extension methods.
I like to think of extension methods as utility functions that can apply to a broad base of classes. I am being warned that this question is subjective and likely to ...
I've been reading a lot about the Debug class lately.
I'm pretty torn about it personally. I can see it improving the process of creating really tricky algorithms. But it also adds a lot of code to my app that I have to wade through unnecessarily. Having a Debugger should remove the need for boiler plate code, whether it is stripped ...
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 am not a fan of boilerplate code: copy-paste reuse is potentially error-prone. Even if you use code snippets or smart templates, there is no guarantee the other developer did, which means there's no guarantee they did it right. And, if you have to see the code, you have to understand it and/or maintain it.
What I want to know from the...
I'm using the MFMailComposeViewController to send an email from within an iPhone v3.0 application. I programmatically create the message body text and display it before showing the picker.
At the bottom of my message body text is the string "Sent from my iPhone." Is there anyway to modify this text or prevent it from appearing? A cursor...
I have a bunch of occurrences of this kind of boilerplate code in my ASP.NET project.
<div class="inputfield">
<div class="tl">
<span class="tr"><!-- --></span>
<span class="ll"><!-- --></span>
<div class="lr">
<div class="cntnt">
<asp:TextBox .../>
</div>
</div>
</div>
</div>
As you may have gu...
I am just curious on how people solve this. I often write the same type of code all the time. For instance:
new Thread() {
//...
//...
//...
//Change this line
//...
//...
}.start();
I keep changing the line where it says "Change this line" and then starting a thread. This change can be one line or a few lines. How w...
There are a lot of "primitive" boiler plate types of data classes that could appear in many different programs.
However, I have never seen a class or library set that recognizes the need to combine all these things with common logic required for them such as validation.
Example classes ([] brackets correspond to classes also in hypothe...
Is there a way to use folds or some other Vim-script black magic to hide license blocks at the top of files? I don't like that they take up such a large section of my editing pane; I like to get a sense for what a file is doing when I first open it, rather than a face-full of boilerplate.
...
I have written a XML parser with DocumentBuilderFactory for a complex XML file. Because there are many different node types that there are many boilerplate code. For every node type (NodeName) I have a loop over the children and a switch for the possible children elements.
Is it possible only to register the needed code for the differen...
Year 2010 and we still have to write boilerplate codes. Lets assume we are building an online application (it doesnt matter wherter it is fancy or not but a funtional one). We first make database design and put some business logic on it (stored procedures, unique or not etc) then we code server side and write most of the business logic o...
I'm generally unsatisfied with writing code like this:
let load_record_field cursor gets geti gett a = function
| 0x01 -> let c, s = gets () in (a.a_record_uuid <- s; `More_record c)
| 0x02 -> let c, s = gets () in (a.a_group <- s; `More_record c)
| 0x03 -> let c, s = gets () in (a.a_title <- s; `More_record c)
| 0x04 -> let c, ...
In the example given in http://web.archive.org/web/20080622204226/http://www.cs.vu.nl/boilerplate/
-- Increase salary by percentage
increase :: Float -> Company -> Company
increase k = everywhere (mkT (incS k))
-- "interesting" code for increase
incS :: Float -> Salary -> Salary
incS k (S s) = S (s * (1+k))
how come increase functio...