≡ Menu

Windows Disks Keep Filling Up with Small Log Files

I noticed that a Windows server I use for development with Visual Studio 2013 Ultimate had begun filling its system drive with log files in C:\Windows\Temp for no apparent reason.

The initial response of our infrastructure group was to simply delete the log files on a weekly basis, as no one could find the cause of the problem. Since this issue was apparently in the purview of that group, I let this solution stand initially. However, as I feared, the problem became worse and the server began crashing on a weekly basis.

The log files had many messages that contain “Product: Microsoft Visual Studio Professional 2013 — Configuration completed successfully.”

I wasn’t sure that the log files were the cause of the crashes, but it became apparent that the two were likely connected when I saw many similar errors in the Application log under Event Viewer: “Detection of product ‘{9C593464-7F2F-37B3-89F8-7E894E3B09EA}’, feature ‘Testing_Tools_for_Pro_x86_enu’, component ‘{55E69908-5292-4B15-A56D-822A6050848F}’ failed. The resource ” does not exist.”

Application log entry

There are a couple of fixes that should be applied here. The first is very simple. In all likelihood, a folder named “Microsoft.NETFrameworkURTInstall_GAC” is missing from the %SystemRoot% (usually C:\Windows) folder.

If this folder is, in fact, missing, add it using either
1.an elevated Command Prompt with this command:
mkdir %SystemRoot%Microsoft.NETFrameworkURTInstall_GAC
or
2. PowerShell:
mkdir $env:SystemRoot\Microsoft.NETFrameworkURTInstall_GAC

The second fix is to repair Visual Studio 2013 in the Control Panel.

Open Control Panel, open Programs and Features, select Microsoft Visual Studio 2013 [Professional/Ultimate/etc.], click Change, and click Repair on the VS splash screen.

In most cases, this will fix your problem.

Sources:
Visual Studio 2013 continuously repairs producing many small log files
Event log endlessly reports installation errors

Missing Components After Moving a ColdFusion Site

Last week I was tasked with moving several of my applications from one CF 8 server to another one, due to the first server’s VM host having some kind of problem requiring daily restarts of the VM by our infrastructure team.

After moving two applications, the users began complaining that one of the functions in one of the applications that had previously worked perfectly was not working at all for some users now.

IE 11 Developer Tools window

IE 11 Developer Tools window showing debugger options

By opening Developer Tools in Internet Explorer (this is not a Chrome-compatible application), and setting the “Break on all exceptions” option in the debugger, I was able to begin troubleshooting the problem.

The exceptions in JavaScript that were being thrown dealt with missing classes, including declared ColdFusion components and ColdFusion.Ajax functions.

I remembered at that point that I had forgotten to do something that all ColdFusion developers should do on each application: to create the CFIDE virtual directory in IIS.

Once this simple task was done, everything worked as expected.

Ruby on Rails Tutorial and Screencasts for Rails 5 Are Available!

The new Rails Tutorial from Michael Hartl is available at his main site and also at Learn Enough.

RoR tutorial

Courses for Summer Learning

Two courses that have recently been made available (though I haven’t yet had the opportunity to take) at Code School are Powering Up With React (for React) and an HTML/CSS class called The Elements of Web Design.

Summertime – which is rapidly approaching – is a good time to commit to spending time picking up new skills and refreshing old ones. I have little experience with React, so this presents an excellent opportunity to see what capabilities are made available there.

learning new things

Whether you choose to take the above courses, or look elsewhere for learning, commit to spending a little time each day studying to pick up new skills – it may not sound like much effort to spend toward a large task, but the results could surprise you!

While I think the venerable Ruby on Rails Tutorial is still the best way to learn Rails, jumping into this tutorial can be challenging for those who are new to programming.

With the fourth and latest beta of Rails 5 being released this past week, it is appropriate that Michael Hartl, the creator of the Rails Tutorial, has devised yet another tool to help new and experienced developers learn enough to make the most of it.

Appropriately, the title of this site is “Learn Enough to Be Dangerous”.

current courses at Learn Enough to be Dangerous

As of the end of April 2016, only three “Learn Enough” courses are available: Command Line, Text Editor, and Git. However, future courses including HTML, CSS & Layout, JavaScript, Ruby, Sinatra, and the Ruby on Rails Tutorial for Rails 5 are scheduled to be added.

The cost is $29 per month, the same as Code School (if you subscribe on a per-month basis to CS). Unlike CS, there is not yet a discounted yearly rate.

Since I’m excited to see the new Rails Tutorial as soon as it’s released, I’ve decided to sign up. Were it not for the access to this mammoth resource, I don’t know that I would pay this price – but considering that the Rails Tutorial with screencasts generally costs about $150 by itself, it seems like a reasonable deal. At any rate, I’ve come to expect only the highest quality learning materials from Dr. Hartl, so I am definitely looking forward to the upcoming classes.

Changes in the ColdFusion.window.create Function Require a Modern Browser

I’m still working on upgrading some older CF8 applications to CF11. I came across an interesting problem, the exact cause of which I have not found, but I do have a solution of sorts.

When the particular application I’m working on now was written, the standard browser that would be accessing it was Internet Explorer 8. Over time, as we have upgraded our browsers, but not had time to make changes to the application to accommodate those new browsers, we had used the dreaded Compatibility View to keep the look and feel of the application unchanged.

Since we are now several versions out from CF8, it is understandable that some things intrinsic to ColdFusion have changed. Somehow, the way that the function ColdFusion.window.create renders JavaScript to create the pop-up window does not work with IE 8 or a newer browser emulating IE 8 (as we forced with the X-UA-Compatible HTTP header in IIS). After copying the website to the CF11 server, setting up everything in IIS, and navigating to the website, everything was great until I clicked on a link that executed a function (named “createCFWindow”, as in the dialog box below) that called the ColdFusion.window.create function.

This is the result:

error dialog box

After stepping through the code using Internet Explorer’s Developer Tools, I determined that the reason this “createCFWindow” function threw an exception was because the ColdFusion.window.create function was returning null rather than a new window.

When testing the website on Chrome – which this application was not designed to use – I discovered that the error did not occur, and decided to turn off Compatibility View. Sure enough, this error disappeared in IE 11 – though a host of other issues have now developed.

Now, I’m working to upgrade the application to be HTML5-compliant so it will work on IE 11 or Chrome.

Apparently, using CF UI tags became unfashionable quite some time ago, but that type of advice isn’t always heard or heeded until long after it’s announced.

Any future applications I build will use jQuery instead for this sort of thing.

Using Ruby to Get All Links from a Sitemap XML File

I was looking at the cached pages on the Wayback Machine and decided to find out if that site had an API. (It does.) I wanted to find a way to use this API to submit links to the Wayback Machine database. As it turns out, a Ruby gem called WaybackArchiver has already been written for just this purpose!

Now that I had an easy way to submit multiple URLs, I got to thinking about how this could be more easily automated. What if I had a sitemap that contained all of the links I wanted to submit? What if there is already a gem to parse a sitemaps.org-compliant sitemap, such as the one on WordPress sites that use the Google Sitemap Generator Plugin?

a sitemap.xml file

My WordPress sitemap, generated by the Google Sitemap Generator Plugin

Even though all of these things exist, I have not found where they have been combined, so I did just that. The Ruby script I wrote requires several gems:
1. WaybackArchiver, for submitting links, sitemaps, or pages to the Wayback Machine
2. Sitemap-Parser, for parsing sitemaps
3. OpenURI, for opening websites
4. Nokogiri, for parsing XML (also HTML, SAX, and Reader) files

If these gems are not installed already, you can install them at the Ruby prompt with “gem install” and the name of each gem.

The script, which I named map.rb, is below.

require 'wayback_archiver'
require 'sitemap-parser'
require 'open-uri'
require 'nokogiri'

mainSitemapURL = ARGV[0]
if not mainSitemapURL.nil?
  puts 'Running...' #+ mainSitemapURL
  
  
  #mainSitemap = SitemapParser.new mainSitemapURL
  mainSitemap = Nokogiri::HTML(open(mainSitemapURL))
  #puts mainSitemap
  mainSitemap.xpath("//sitemap/loc").each do |node|
    #puts node.content
    subSitemapURL = node.content
    subSitemap = SitemapParser.new subSitemapURL
    arraySubSitemap = subSitemap.to_a
    (0..arraySubSitemap.length-1).each do |j|
      #puts arraySubSitemap[j]
      WaybackArchiver.archive(arraySubSitemap[j], :url)
    end
  end
end
puts 'Finished.'

This script works unaltered with WordPress sitemaps created by the plugin mentioned above. These sitemaps actually produce a sitemap index, with individual sitemaps being linked here – so each of the linked sitemaps are also parsed. The above script can be run at the Ruby prompt with “ruby map.rb URL“, substituting the URL for the sitemap.

Should your sitemap be organized differently, this code may not work as-is, but may require changes depending on the node tag names.

Other pages that were helpful in developing this tool:
Looping through each xml node (on Stack Overflow)
Web Scraping with Ruby and Nokogiri for Beginners
Parsing an HTML/XML Document