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

OK - maybe everyone else knows this, but after about a year of getting so-so support for intellisense in Javascript I downloaded the latest hotfix and hoped that this would fix it...it did not.  Since I have a very unhealthy addiction to Intellisense I figured out it was time to do a little troubleshooting and get this to work.  When adding the the script tags to my page to get intellisense, my Error List now contained the message:

Error updatign JScript IntelliSense: [SOMEPATH]\Temporary Internet Files\Content.IE5\[XXXX]\[XXX].js 'jQuery' is undefiend @ 9.1

So I figured if I could make this error go away chance are pretty good IntelliSense would start working again.  What I found is if you use the absolute path /FOO/FEE.JS in your script tag you get this error message.  If you don't and use a relative path ../FOO/FEE.JS all is well.

One other thing I found while searching the web (sorry I forgot the site so I can't give the person credit) is to get your Intellisense to work when using Masterpages

This allows for the design time to pickup the script file, but at run time the file won't be duplicated, especially since my JS files stored as a resource in.  I have my JS files compiled as an embedded resource and for some reason, adding those embedded resources to the ScriptManager, Scripts sections doesn't allow IntelliSense to add the files as you would expect.  Maybe in another year I'll get around to troubleshooting that, time to get some work done!

-ec

11/22/2008 10:07:43 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   AJAX | ASP.NET | JScript  |  Trackback
 Sunday, November 16, 2008

Early on in my career I was mentored on deferring execution.  This was in a language called FORTH and the idea was build your program structure and abstract the details into WORDS to be filled in later.  Repeat until complete.  This simple process still holds true today in OO languages like C# where I do most of my work.

Now back to why I like Silverlight/WPF, as I'm just starting to get beyond the basics, the more I'm starting to see that this is an extremely well thought out architecture.  As I'm developing my functionality I can easily "defer execution" or really in this case, care zero about the style and then go in later and make it pretty.  Or if I'm really lucky find someone that knows what they are doing to give it a polished look.  Although the same can be done with HTML and CSS, this just seems like it's just a bit cleaner and since we are targetting only one type of client (Silverlight or WPF) instead of the different browsers the results are much more repeatable.

The other thing I'm really impressed with is the separation of UI and code behind.  Although time will tell on the actual business value (read ability to maintain and extend) it seems like the ability to create CLR instances in the XAML and then glue everything together with dependency properties, just feels good to do.

Now back to getting some work done with this!

-ec

11/16/2008 1:56:42 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   .NET 3.5 | ASP.NET | Silverlight  |  Trackback
 Wednesday, November 05, 2008

In all my web sites my pages inherit from a custom base page that inherits from System.Web.UI.Page and overrides OnError.  This method then uses Server.GetLastError() to get the exception generated by the offending code.  At this point, it's probably too late to do anything about it, but at least I can take a snap shot of the current user context, log that information present a friendly message to the user.  Although the bug made it into production at least it's not happening 200 times a day and I don't know about.

A good portion of my site is driven by web services via AJAX and as I start to implement Silverlight for a few sophisticated UI components, I'm relying more and more on web services.  My problem until now was I didn't have any sort of catch-all that notified me about problem in a web service call.

After a bit of research I found something called a SoapExtension in the System.Web.Services.Protocols namespace.

This provides calls at different points in the processing of the soap message:

We can implement some functionality in the AfterSerialize stage.  If we detect a non-null value in the message.Exception property it's probably safe to assume something bad happened within the web service.

The final step is to register this in the web.config file.

In addition SoapExtensions can be associated with specific methods via attributes.  This might be interesting to provide an interesting solution for attaching custom authentication and authorization.

-ec

11/5/2008 8:27:49 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   ASP.NET  |  Trackback
 Monday, November 03, 2008

I've finally found a good excuse to implement something using Silverlight 2.0 within my web product.  After spending about 3-4 hours attempting to get my Silverlight app to talk to a local web service, I found out something that hopefully will save you some time.  First a little about my environment.  I'm using IIS 7.0 on a 64 bit machine.  I have IIS setup with two sites for my Silverlight development, the first hosts my web service, the second hosts the web site containing my Silverlight application.  I have my hosts file setup as follows

127.0.0.1   webservice
127.0.0.1   website

Then in IIS I bind the the web sites to those host names.

After setting up the clientaccesspolicy.xml file in my webservice site to allow Silverlight to access I just couldn't get my Silverlight app to talk to my web service.  I tried this in both IE and Firefox with no luck.  After doing a little testing, I found it worked when I used the development web server (I think this was formally called cassini) it also seemed to work when when I used the host name "localhost".  Next I fired up fiddler and watched the network traffic.  Anytime I used cassini or local host, the clientaccesspolicy.xml was downloaded and the call to the web service succeeded.  If I tried this through my site, no request was made.

After trying a number of things I found I was able to get this working by opening the security settings within Internet Explorer

Tools->Internet Options->Security Tab, then click on Local Intranet and add my two sites.  This seemed to do the trick for both Internet Explorer and Firefox.

Hope this saves you a bit of time

-ec 

11/3/2008 8:50:58 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   ASP.NET | Silverlight  |  Trackback
 Thursday, October 23, 2008

From George S. Patton

Good tactics can save even the worst strategy. Bad tactics will destroy even the best strategy.

Let's relate that to software:

Strategy = Architecture

Tactics = Programming

If you have a poor architecture, it can be made up for by great programmers, but if you have poor programmers implementing software on a great architecture results will probably still be poor. 

-ec

10/23/2008 6:35:40 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   Extreme Programming | Moments of Clarity  |  Trackback
 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
Copyright © 2009 Kevin D. Wolf. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: