Blog Home  Home RSS 2.0 Atom 1.0 CDF  
The Efficient Coder - Thursday, July 03, 2008
There has got to be a better way of communicating with our computers!
 
 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
 Wednesday, June 11, 2008

I've got a couple mobile projects that need to provide communications services to a centralized server.  Over the past year or so, I've been getting to know WCF a little better and the more I learn, the more I think this is the one by far that in all the latest Microsoft technologies, that you should invest your time in learning.  Saying that, it would seem logical to think about using WCF as the technology to communicate on our mobile devices.  I'm not sure the answer is clear to me yet on this one.

First, what do I LOVE about WCF, if I had to sum it up, I would say three things,

  1. The formality of defining and implementing contacts for our communications
  2. The ability to configure and for the most part not worry about the transport details when coding your service
  3. The ability to do duplex messaging, I still need to spend some time to see how this works under the hood from a scalability implication, but the concept in general seems powerful.

Saying that, we can make the following assumptions about the current state of mobile devices and applications:

  1. In most cases the device is going to be a client on the client/server side of the equation
  2. Our computing horsepower just isn't the same
  3. Based upon my experience in both worlds (desktop/web AND mobile devices) I would say you can crank out 3-5 lines of desktop/web code in the same time it takes to get one line of mobile code into production
  4. Code on mobile devices can't easily be updated so it really has to be right the first time
  5. As good as our mobile platforms are these days, there are still a few quirks that are beyond our control and device specific

Therefore, most of the benefits of going with WCF really aren't that great in a mobile device.  And if a technology really doesn't provide much value, it may make more sense to keep it simplest technology with the fewest moving parts.  I think as with anything new, one needs to implement and analyze the results.  As I mentioned earlier, I don't have answers here yet, but wanted to start capturing thoughts.

-ec

 

6/11/2008 7:08:05 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2]   .NET 3.5 | Mobile | WCF  |  Trackback
 Thursday, June 05, 2008

I've got an awesome battery in my laptop

I wish I could find more like this

-ec

6/5/2008 7:06:10 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]    |  Trackback
Copyright © 2010 Kevin D. Wolf. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: