Posts Tagged ‘Programming’

ColdFusion and MSSQL NText Fields

Tuesday, August 4th, 2009
Computer science
Image via Wikipedia

Late last week I was working on some new changes to PBR’s web site (my employer) and ran into a nasty snag of an issue. I was pulling data out of a table, and for an exceptionally strange reason, seemingly random HTML kept appearing in the source code. Needless to say, this HTML was breaking the layout I had been working towards and boggled not only my mind, but our SVP of IT’s mind as well.

In the end, we ended up changing the field type as it was held in the Microsoft SQL database. The field was originally set to be an ntext field, and we changed it to a varchar field, as it really had no purpose being an ntext field in the first place, but that’s another story. After we made the change, we did lose some data on the resulting trimming of the data field, however the parts that were trimmed were already migrated to another field, so big loss.

As soon as we changed this, the HTML injections ceased. What happened? I have put some sample code below to illustrate it.

What the code should have came out to be.

Quick Code


<div id="myDiv">
     <p class="indentClass">
          My content was coming out of the db here
     </p>
</div>

What the code actually came out to be before we changed the field type.
Quick Code


<div id="myDiv">
     <p class="indentClass">
          </p>
      <p>My content out of the db here</p>
      <p></p>
</div>

You can see that my opening paragraph tag was automatically closed, a new one started and closed after the database content was published, and an empty paragraph added at the end.

Now it is possible that the site, with the many thousands of pages and hundreds of thousands of lines of code specified this in a CFC or CFTAG file – in other words it was tied to the field name/type to force the HTML output, but I could not find it anywhere.

Any thoughts or experience you may have on this? Share them in the comments.

Reblog this post [with Zemanta]

Been A While – .Net Coldfusion and More

Tuesday, June 30th, 2009

.Net Code Snippet

.Net Code Snippet

Obviously, it has been a while since I have posted on my blog. Quite simply after starting my full time employment contract I have not had time. Why? I am working long hours doing many new things – such as programming in Coldfusion and .Net.

I took on a position of web developer and have now setup 2 Linux servers, coded a C# .Net app from the ground up and am looking at major site updates using Coldfusion. While entertaining, fun and challenging, it has meant a bit longer days at work than I had anticipated – however I am NOT complaining in the least amount. I have a full time job and am paying bills and getting caught up on things. That’s always good!

The past week and a half has brought more changes – I was told we are going to look at revamping the entire site and work and will be doing it in VB.Net, so more learning, which is one of the things I love most about IT and web development – the constant learning, expanding and maintenance of knowledge. With that, we are looking at making it easier to get content out, expanding on and integrating more with social media and getting an infrastructure in place that will allow forward motion, expansion and easier maintenance. This also means a more enhanced visitor and site user experience, which is always something that is highly important.

The other thing of note, is that I will try my best as I go through Coldfusion and .Net programming to get some tutorials, how-to’s and other related posts up on those subjects. I will be learning quite rapidly and am sure to have some struggles to fight through, and those are the items I would like to post about.

Do You Create Value?

Monday, January 19th, 2009

Do you create value? Do you even know what value I speak of?

It seems that there are many voices in the social media/network arena, just as there are in the web development and PHP programming arenas, some claim to be “experts” while others do nothing but “bash” the experts. Human nature to be competitive I guess. But the basic idea is this, everything we do creates value. So to answer the question for you, yes you create value!

So the true question is what type of value do you create? Positive or Negative?

Want to build your followers, interact with the big dogs or sell more product? You had best hope you are out there, daily, generating positive value. Negative value will do nothing more than move you in the wrong direction.

Reblog this post [with Zemanta]