Monday, April 30, 2007

Silverlight

This article just came across my RSS Feed. I was interested in Silverlight previous to this, but without .NET support on the backend, I thought it would not be worth the effort to learn or develop for. Well, Microsoft has done away with my only reason to not learn how to play with this new technology. I just hope that it will be natively easier to use for us lowly developers than Flash is.

According to the article it should be going gold sometime this summer - so I still have a few months left before I need to learn something brand, spanking new.

Success with the Dynamic Divs

Well at least partly. The last post here, I was complaining about the behavior of my drag/drop divs which I created from data returned from the web server. Well the Firefox behavior is still there and annoying.

But the IE behavior I seem to have figured out.

I was using the command DIV.setAttribute("class", "MyDivClass"); to set the class attribute. That command works in Firefox - but apparently not in IE. IE requires DIV.className = "MyDivClass";.

Just one of those small annoyances which is the difference between IE and Mozilla browsers. Frankly, I'm scared to open the site in Opera to see what happens.

Monday, April 23, 2007

Dynamically Generated Divs

For my freelance project, I'm creating a bunch of HTML DIV elements and using Prototype and the Scriptaculous JavaScript library making them Drag/Droppable.

Not a big deal, and the DIVS are being generated - and even drag/drop. But of course there are some errors. And of course, it's different ones for FireFox and IE.

In IE, the classes that I associate with the DIV aren't being applied for whatever reason. Of secondary issue is that since the class is not being applied, the DIV that the elements are dropped into is not registering it as a drop.

In FireFox, when I drop the dynamically created DIV onto the DIV that accepts it, the dynamically created DIV reverts to the top left corner of the page rather than the place where I had gotten it out from.

So, I get to do a decent amount of research in the upcoming short term. Yeah me.

Friday, April 20, 2007

Back to Documentation

I never thought that I would enjoy getting back into a bit of documentation.

But that's what's happened.

Basically, I got some feedback back on the lowest of my design documents (DBDD & SDD), so I put off the research into getting the library working with .NET and jumped back into documentation mode. I've never been so happy to open up a Database Design Description. Monday I get to play around with fixing my SDD - and with the sheer number of screw-ups I made there, I'll probably be doing that until I'm so worn out of documentation that I can jump back into the research/coding thing.

Monday, April 16, 2007

Prototype.js

For my freelance project, I'm using the PROTOTYPE JavaScript library as a means to enable AJAX functionality easily into my website.

But for whatever reason - the functionality pretty much refuses to behave properly. I'm not sure if I'm doing something wrong, or if there's a problem with my configuration of FireFox or if it's something inherently hard about Prototype.

All I know is that I don't need this much hassle - so what I'm going to do is kill the AJAX aspects of the pages, and make it a traditional web application. At least until I get the system working and stable. Then I can go in and layer in AJAX functionality on top of the website to make it more responsive and like a desktop client.

I'm just bothered by the whole hassle of the thing.

Friday, April 13, 2007

I'm Starting to Hate C++.Net

My main focus at work is merging some C .LIB precompiled libraries into a form that can be used by my VB.NET GUI.

One would think that this would be a simple, straightforward process.

Maybe if I knew more about C++ it would be. But as it stands, it's nothing more than a comedy of errors and hassles, designed to drive me batty.

The latest issue is I've got a string, and I'm trying to move the string from HEX to BINARY. Not a big deal?

.... yeah right.

I'm getting a System.ArgumentException complaining about a pointer being in the bottom 64K of the process's address space.

I have no clue how it got there - nor how to get it out.

Go, Microsoft on that one.

I must share!

Today I stumbled across this wonderful little selection of useful tidbits for MS Word. It's a beautiful discussion on how to turn off some of the more annoying 'features' of MS Word - such as documents opening from email attachments in the "Reading Layout."

The usability of MS Word just went up a notch for me.

Tuesday, April 10, 2007

ASP.Net Development Server & Style Sheets

I'm developing my freelance web application using Visual Web Developer Express at the house. And though I do have a full fledged Web Server running IIS I could develop on, I prefer having the actual development being done on my box and then I routinely push the changes out to the website so that my partner can view a stable version of the software.

Not a big issue. It's a good paradigm.

Well it would be, except for whatever reason, the built-in development server is reporting that my style sheets have a mime type of TEXT/HTML rather than TEXT/CSS. The friendly Error Console in FireFox is reporting this:

Error: The stylesheet http://localhost:2877/Lotto/login.aspx?ReturnUrl=%2fLotto%2fcorners.css was not loaded because its MIME type, "text/html", is not "text/css".
Source File: http://localhost:2877/Lotto/login.aspx?ReturnUrl=%2fLotto%2fdefault.aspx
Line: 0
And while once you get logged into the system, it's not a problem - prior to that, when TEXT/HTML files are restricted, it means that none of my pretty styles are showing up for the login screen. And it's not just the VWDE that I'm using at home - it's also my Visual Studio Professional at work. At lunch the other day, I tried it and came up with the same results of CSS being misreported as the wrong MIME type.

And it gets better. Even external JavaScript files are doing something flaky:

Error: syntax error
Source File: http://localhost:2877/Lotto/includes/prototype.js
Line: 3
Source Code:
Google, Asp.Net, MSDN and Google Groups are, of course, utterly unhelpful with this particular issue.

Of course, while I was building my little blog entry here, I realized what was truly happening.

I had disabled the ability for things to be retrieved from the web server without authentication. Which meant, any request prior to the user being logged into the system would be met with the login prompt. Which meant that I was trying to load in my LOGIN page in my style sheet & script tags.

It's at times like these that I feel utterly brilliant.

Anyways, moving my stylesheets to my INCLUDES folder and then adding in the following to my web.config solved my problem.

<location path="Includes">
<system.web>
<authorization>
<allow users="*">
</allow>
</authorization>
</system.web>
</location>

Now, if only I had the time I spent trying to figure this out back. Though I guess, that's what I get for not paying close enough attention to the message that Error Console is reporting to me.

Monday, April 2, 2007

C Libraries and .NET

This is still insane. I spoke early last week about .NET and my C Library problem - which is the root cause of me not having any spare time to blog about programming and have discovered a bit more.

If I run the library directly through a C++.Net Console application it works without a problem. But if I try to use the DLL version even in the Console application it gives me the NULL REFERENCE exception.

The only thing that makes sense to explain this issue is that since the DLL version uses a class as a container for the various methods where I pass data to/from the library in a "managed" way this is setting aside a certain bundle of memory for the library. Which the library tries to get outside of by doing a MALLOC call, and thus resulting in the NULL REFERENCE exception.

So I'm faced with three possibilities (excluding retiring the project, which is a decision I can't make):

  1. Rewrite the libraries in a .NET language
  2. Write a C++.Net console application and call that from the VB.Net GUI when I need to do something - passing data through the command line and file I/O
  3. Write a Windows Service in C++.Net and pass data to/from the service via the Message Queues
Option 1 was shot down in an earlier meeting - but it's always there. So that leaves us with options 2 and 3.

Now, I can admit it's been years since I've done any serious C++ programming. Not since I graduated college - it's an atrophied skill as my job is a VB shop. The closest I've come is a bit of C# programming when the task I need/want to do is easier to implement there than in VB.

So with that in mind, I came up with this table to determine which of the last two options I should consider.

Service

Console

About

Use a Windows Service and Message Queues to send/receive data

About

Use either a series of task-specific console applications or a single console application with task flags. Use VB.Net to launch those applications and feed in parameters on the command line. Output saved to a file which the VB.Net application then reads in.

Pros

· Simpler to maintain than a series of task specific applications

· Can pass well-defined data easily through the message queues

· No File I/O

Pros

· Easier to develop

Cons

· Harder to code

· More complex system

Cons

· Memory Intensive from launching all the small applications

· Slow due to File I/O

Need to Learn

· Coding windows service in C++.Net

· Using Message Queues in C++.Net

Need to Learn

· How to launch other applications within VB.Net via its internal scripting system

· Refresh how to pass arguments into a console application via the command line when the system begins executing

Blog Widget by LinkWithin