Blog Home  Home RSS 2.0 Atom 1.0 CDF  
The Efficient Coder - Tuesday, October 21, 2008
There has got to be a better way of communicating with our computers!
 
 Tuesday, October 21, 2008

I belive the following is accurate for developing 95% of business applications:

  1. People buy software to solve problems, that can be making their life easier, making money or providing pleasure (don’t read too much in to that J)
  2. Features enable solutions to problems.
  3. When we write software, we build features.
  4. With the right level of abstraction there is a common and finite set of features to be implemented in code.
  5. Applications should be built by tailoring features to solve a user problem. 
  6. If tailoring features has to be done by writing code, so be it, but this is very costly in terms of time and money.
  7. It’s preferable to have this done via configuration.

-ec

 

10/21/2008 4:38:03 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   Software Engineering  |  Trackback
 Monday, July 21, 2008

I have the need in my application for users to upload many different types of documents and images.  Currently I have two ways of doing this; the first is to save to a set of directories organzied by user in a file system, the second is in the data base.  Neither of these are really ideal for many reasons that I'm sure you recognize.  To resolve this issue, I built a component that extends the ASP.NET file upload control to allow you to save files to the Amazon Simple Storage Servce (S3).  I've released the source code and component with an open source license, so you can download this and use in your projects as well.  The download as well as documentation can be found at http://downloads.slsys.net/S3FileUpload/Default.aspx.

Enjoy and feedback is appreciated!

-ec

7/21/2008 6:39:54 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   ASP.NET  |  Trackback
 Friday, July 04, 2008

As a developer, I appreciate the complexity and I'm trying really hard to like Vista (SP1) but sometimes it's a bit on the frustrating side...

Then after loading Visual Studio .NET and trying to do some work, the reason became obvious

:-)

Anyway, after rebooting all is well.

-ec

7/4/2008 3:38:34 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   Lighter Side  |  Trackback
 Thursday, July 03, 2008

Well if you saw my garage, you know I should be the last one talking about this, maybe I use up all my organizational energy on the code I write?

Anyway, in a project I've been working over the past year or so, I've been using the ASP.NET Themeing concept along with CSS to build a "skinnable" product.  Skinning will for the most part be accomplished via CSS.  As I've been adding features, I've sort-of hacked together the required CSS as a new feature was added.  These were organized into different areas, and named appropriately, but as I started to build additional themes, it just got fairly complex making sure everything got lined up and styles didn’t get messed up in different CSS’s.

 
Here is an example of my original CSS for section of the application, imagine there are about 12 other sections similar to this

/* -------- Edit Panel ------------ */
div.edit-panel
{border:1px solid #AACCEE;text-align:left;width:400px;background-color:white}
div.edit-panel-header
{background-color:#EBF3FB;border-bottom:1px solid #AACBEE;margin:0pt 0pt 6px;padding:3px 6px;}
div.edit-panel-header-tight
{background-color:#EBF3FB;border-bottom:1px solid #AACBEE;padding:3px 6px;}
div.edit-panel-header
span{color:#07519A;font-family:Verdana;font-weight:bold;}
div.edit-panel-header-tight
span{color:#07519A;font-family:Verdana;font-weight:bold;}
div.edit-section
{padding:4px;font-family:Tahoma;font-size:9px}
.edit-section-caption
{display:block;font-weight:bold;padding-left:5px;color:#07519A;font-size:1.2em;font-family:Verdana}
div.edit-section-save-bar
{text-align:right;padding-left:4px;padding-right:3px; padding-bottom:3px}
div.edit-section-save-bar
a {color:#075191;text-decoration:none}
div.edit-section-save-bar
a:hover {color:#075191;text-decoration:underline}
div.edit-section-validation-error
{padding:4px}
div.edit-section-validation-error
span {color:Red;}
.edit-section-input
{border:1px solid #AACCEE; color:#606060 }
.edit-section-textarea
{border:1px solid #AACCEE;width:98%; color:#606060 }
.edit-section-select
{ border:1px solid #AACCEE; color:#606060 }
span.edit-section-required-symbol
{ color:Red;font-size:8pt;font-family:Verdana }
span.edit-section-message-bar-error
{}
span.edit-section-required-symbol
{}
/* -------- Edit Panel ------------ */

So now I wanted to change the color scheme and make things look consistent across the application, how would I know I made all the borders look correctly?  How about all the fonts and or back ground colors, you would have to wade through the noise and hope you got everything.  Although I don’t always succeed, I really try to keep my code organized into certain patterns that is to say if I need to add an event handler to a WebForm, well, I’ve got a #region block in my code and all event handlers get placed in that #region.  So thinking about it, why should CSS be any different?  I adopted the following organizational strategy to make this a bit easier to manage, it’s a little bit longer, but if I want to change colors, I can just work in one area and make sure I get them all right.

 

/* -------- Edit Panel ------------ */
/* Colors */

div.edit-panel
{border:1px solid #AACCEE;background-color:white}
div.edit-panel-header
{background-color:#EBF3FB;border-bottom:1px solid #AACBEE;}
div.edit-panel-header
span{color:#07519A;}
div.edit-panel-header-tight
{background-color:#EBF3FB;border-bottom:1px solid #AACBEE;}
div.edit-panel-header-tight
span{color:#07519A;}
div.edit-section-validation-error
span {color:Red;}
span.edit-section-required-symbol
{ color:Red;}
.edit-section-caption
{color:#07519A;}
.edit-section-input
edit-section-select edit-section-textarea  {border:1px solid #AACCEE; color:#606060 }
div.edit-section-save-bar
a {color:#075191;}
div.edit-section-save-bar
a:hover {color:#075191;}
/* Colors */ 

/* Layout */
div.edit-panel
{text-align:left;width:400px;}
div.edit-panel-header
{margin:0pt 0pt 6px;padding:3px 6px;}
div.edit-panel-header-tight
{padding:3px 6px;}
div.edit-section
{padding:4px;}
.edit-section-textarea
{width:98%;}
.edit-section-caption
{display:block;padding-left:5px;color:#07519A;}
div.edit-section-validation-error
{padding:4px}
div.edit-section-save-bar
{text-align:right;padding-left:4px;padding-right:3px; padding-bottom:3px}
div.edit-section-save-bar
a {text-decoration:none}
div.edit-section-save-bar
a:hover {text-decoration:underline}
/* Layout */ 

/* Fonts */
div.edit-section
{font-family:Tahoma;font-size:9px}
.edit-section-caption
{font-weight:bold;padding-left:5px;color:#07519A;font-size:1.2em;font-family:Verdana}
div.edit-panel-header
span{font-family:Verdana;font-weight:bold;}
div.edit-panel-header-tight
span{font-family:Verdana;font-weight:bold;}
span.edit-section-required-symbol
{font-size:8pt;font-family:Verdana }
/* Fonts */ 

/* Misc */
span.edit-section-message-bar-error
{}
span.edit-section-required-symbol
{}
/* Misc */
/* -------- Edit Panel ------------ */

 
-ec

7/3/2008 10:08:35 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]    |  Trackback
 Thursday, June 26, 2008

In ASP.NET 1.1, if you wanted to upload a file you needed to make sure that you added the following text to your ASP.NET form declaration:

In ASP.NET 2.0 adding a file upload control to the form must have done this behind the scene since this was no longer a requirement.

I've been fighting an issue in my application where the file didn't get uploaded the first time the form was rendered, I have an update panel with a grid that when clicked upon displays the details record.  That detail record then has file upload control, and uses the method I wrote about earlier to upload the file within a control rendered in an Update Panel.

Although I haven't spent the extra time tracking this down to the bits, it's my assumption that the page originally get's rendered without the FileUpload control and the Form doesn't contain the encoding type.  Then when the file upload control does get rendered to the page, it doesn't update the form encoding type attribute.  So the solution is to just add the enctype='multipart/form-data' to the form tag.  This seems to resolve the issue and does indeed make sense.

-ec

 

6/26/2008 8:02:34 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]    |  Trackback
 Saturday, June 14, 2008

In a previous life I was an embedded systems programmer, there was nothing like defining the hardware, getting the boards made up, and creating the equivalent of the "Hello World" program to make sure hardware can come to life, something as simple as a flashing LED or toggling a pin and checking via an oscilloscope.  I used a language called FORTH which I still have a soft spot for.  Although probably unreasonable, I think everyone should go through this process; “programming close to the metal”; it give a completely different perspective on writing code (I ?think? a good one).

Flash forward about 13 years and I find myself doing web systems, this is not at all a bad thing.  We’ve recently went live with a site www.uspaymail.com and again my perspective is changing, perhaps it’s the problem domain in this case.  We have built the system on a solid set a of services both UI and data layer that I’ve been evolving over the past 7 years.  Therefore adding new features is relatively straight forward.  This application has also a very solid and predictable revenue model, basically if we sign up users and we sign up advertisers, our revenue is predictable.  At this point our mission statement to grow our application and thus income model is to sign up users (and keep them coming back) and advertisers, anything else is secondary, and thus the concept of “programming close to the metal” isn’t going to be referred to as making the microprocessor dance, but providing an experience for both the user and the advertiser as pleasant and rewarding as possible.  How do we do this or more importantly how do we know how we are succeeding?    First we define our currency or what metrics are important to succeeding in our goal.  These seem straight forward, but these metrics should be visible to everyone on the team.

 

·         Total number of subscribers – How many users are currently signed up

·         Total number of new subscribers per day – On each day how many new people signed up

·         Percentage of users on each day that access the site – Total number of unique users that access the site on each day over the total number of subscribers, currently we have a target of 33% but that metric still needs a little more definition.

 

 What we did for our app in our administrative console, we have a marketing section (possibly incorrectly named) that has the following charts that are live:

 

Total Site Subscribers

 

New Subscribers Per Day

Returning Users
The current day is live so the number grows through out the day)

As the techie responsible for this site, I also have a considerable number of metrics on the backend that measure application performance.  Basically these measure the time between ASP.NET page life cycle events such as Pre-Init to Init.  I’ve also instrumented our layer on top of the database to measure the time each query takes, if a query takes more than 10ms, I log that.  This will be key to keep our application snappy.

 

So now that we have our metrics, it’s very helpful in prioritizing work.  Our system at this point is 100% functional so feature can be prioritized based upon the impact they have on improving our defined metrics.  Since we have these metrics very visible, it’s easy to see if we are moving closer to the mark or we are just spending developed dollars on non-value add items.  And thus we are working close to the metal even though there are many layers of abstraction between our application and the processor.

 

As this progresses, and as I learn more about what works and what doesn’t I’ll continue to post my findings.

 

-ec

6/14/2008 1:17:13 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]    |  Trackback
 Friday, June 13, 2008

Got a great tip from listening to the pod cast at http://www.stackoverflow.com/ (if you don't subscribe you should!).  Jeff Atwood in passing mentioned a program I've been looking for, for a long time.  It's called WinSplit Revolution.  I'm big time into multiple monitors, here's a picture of my previous setup, my current one is similar, but have a 24" as my main monitor, then two 21" on each side and finally a 900x1440 off to the left.

  • My center monitor is used for editing source code editing, my primary source of revenue. 
  • Left 21" monitor has all the extra VS.NET windows such as solution explorer, output, error windows etc...
  • Right 21" monitor has the output of the project I'm working, usually have IE and Firefox open.
  • I recently added back in the far left monitor, a 900x1440 in portrait mode.  On this monitor, I've got my email and Debug View.

Anyway back to the WinSplit Revolution, this program uses a CTRL-ALT-NUMPAD KEY to position the current quadrants on the screen.

Check this one out, you won't be sorry!

-ec

6/13/2008 12:11:50 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   Hardware | Software Engineering  |  Trackback
 Thursday, June 12, 2008

I've built some ASMX web services (yes these should be converted to WCF, but they work for now).  I'm starting to use these as Script Services for some ASP.NET Ajax Enabled pages.  I ran into a problem where some of the "stuff" I didn't want to have happen in some properties on the objects returned by the server were getting executed even though they were marked as [XmlIgnore()] which disables them for SOAP tASMX type web calls.  Apparently when the returned objects get serialized as JSON for a script service, they ignore the [XmlIgnore()] tag, which I guess makes sense but is rather inconvenient, in that I need to go back and do a manual search & change.  Within the using System.Web.Script.Serialization namespace there is another attribute you can decorate your properties with called [ScriptIgnore()] that seems to do the trick.

-ec

6/12/2008 10:07:58 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1]   ASP.NET | WCF | AJAX  |  Trackback
Copyright © 2009 Kevin D. Wolf. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: