August 2003 - Posts - Jon Galloway

August 2003 - Posts

Fix for: 'Server Application Unavailable' Error after Applying Security Update for IE

Some of my co-workers have been hit by this - Windows Critical Updates cause ASP.NET to return a “Server Application Unavailable“ error on every request. Affects on only .NET 1.0 framework on XP.

http://www.asp.net/faq/ms03-32-issue.aspx

Posted by Jon Galloway | with no comments

Splitting DotNetRocks MP3 files

If you too like to listen to DNR in MP3 format but would like the files split into smaller files, this may help you. My car cd player can play MP3's, but if I switch CD's (or even tracks) part way through, I have to hold down the fast forward button for 10 minutes to get back to where I was at. I had a cool freeware program that did it, but when DNR switched to VBR format the freeware program choked. Here's the solution I found:

http://mp3splt.sourceforge.net/ - open source command line program to split MP3 files. latest version handles VBR.

The commands for mp3splt are true to sourceforge form - not too user-friendly. Here's a batch file that will process all MP3's in a directory (assumes mp3splt installed in default dir, new DNR MP3's go in c:\dotnetrocks\fresh\, and split ones go in c:\dotnetrocks\split\):

c:
cd \
cd C:\Program Files\mp3\mp3splt-1.9\
for %%f in (c:\dotnetrocks\fresh\*.mp3) do mp3splt -f -t 1.30 %%f -a gap=15,th=0.82 -q -d c:\dotnetrocks\split\

I know this ain't no .NET solution, but it works. I messed with a custom one for a while, but it turns out splitting MP3's - especially VBR ones - without artifacts at the split points is not super simple.

Posted by Jon Galloway | 4 comment(s)
Filed under:

It all comes down to the motivation

One of the things that irritates me is the fact that most universities teach software engineering the DOD-way...

Wow. I've been thinking about this post since I read it a few days ago. I work for a big financial company, and I deal with this constantly - every spec, no matter how simple the subject matter, is ridiculed and written off if it's under 100 pages... but no one really reads it. Business Analysts with no real understanding of the data or systems hash how things will work before they get the technical folks involved, only to find out that they've specified an impossible solution. Don't get me wrong, I love my job, but it's definitely not the most efficient environment for building high quality software...

It's amazing how the software development community falls into two camps - but I think it all makes sense. It all comes down to what's motivating your development. DOD development is about trying to prevent disaster, and - if it happens - assigning the blame to someone else. UML, Rational, OOP, documentation - they're great tools in the hands of an efficient software shop, but they can only be the focus if building quality software isn't.

Microsoft style development - the MSF, etc., is about seizing opportunities in the most efficient manner possible. As some component vendor used to say, the point is productivity.

So, if your development shop's culture (not just the broader corporate culture) places the highest value on pleasing customers, then you'll use whatever tools help meet that end more efficiently. It's development capitalism - survival of the fittest methodologies.

If your development shop becomes disconnected from pleasing the end user, then the process will become illogical to those who assume that perspective. People become more concerned with not getting fired. Process becomes a checklist - is it OOP (whatever that means)? Check. Are there sequence diagrams? Check... The economic analog of process over efficiency is communism - an ominous model for a company to emulate.

Which all comes back to why Microsoft's continued success is the result of an enormous, top down effort to maintain the right focus. “Stay hungry”, avoid the temptation of assuming the status quo, and realize that the only thing that matters is how efficiently you deliver the end users what they really want. That's not a topic that's likely to excite most computer science professors, to return to the main topic of the original post.

Posted by Jon Galloway | with no comments

Scheduling a WebService

How to schedule a webservice method call (using MS Task Scheduler)? The only way I could find was to create a VBS file that calls the WS, and schedule that:

Set oServerXML = CreateObject("Msxml2.ServerXMLHTTP") 

oServerXML.Open "GET","http://localhost/wsPDF/Pdf.asmx/CreateFromQueue?", False
oServerXML.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
oServerXML.send
Set oServerXML = nothing
Posted by Jon Galloway | with no comments
Filed under:

XML - InsertSingleNode?

It's easy to get data out from an XML doc given a path (doc.SelectSingleNode(@"/customer/address/zip"), but what about building an XML doc bit by bit? What about InsertSingleNode? There are plenty of times where programatically building an XML doc at the object level doesn't make sense or isn't possible, and plenty of cases where there isn't an object to be serialized (say, on projects I'm stepping into late in the game, or where the XML document format is dynamic).

Here's a simple method I used to add a value to an XML doc by a path. This doesn't support XPath syntax (beyond the simple “/” delimited node hierarchy). Is there a better way?

1:     public void InsertSingleNode(string strValue, ref XmlDocument doc, string strXmlPath)

2: {
3: string[] str = strXmlPath.Split(new char[] {'/'});
4:
5: XmlNode node=doc.SelectSingleNode(str[0]);
6: if (node==null)
7: node=doc.AppendChild(doc.CreateElement(str[0]));
8:
9: for(int level = str.GetLowerBound(0); level <= str.GetUpperBound(0); level++)
10: {
11: XmlNode sub=node.SelectSingleNode(str[level]);
12: if (sub==null && level!=0)
13: sub=node.AppendChild(doc.CreateElement(str[level]));
14: else
15: if(level==0)
16: sub=node;
17:
18: if(level==str.GetUpperBound(0))
19: sub.InnerText= strValue;
20: else
21: node = sub;
22: }
23: }


Posted by Jon Galloway | with no comments
Filed under:
More Posts