debugging applications

Last week I was asked to look at an issue we were having with a FTP component. I was asked to look at it as I was the last person to look at that section of code, about 6 months ago.

Our clients use this to upload images that they are going to use on their websites, with some logic to figure out if the image is to be served up as http or https.

Earlier in the year the secure uploads stopped working. At some point, either in a microsoft upgrade, or an upgrade to the FTP server software itself, the path to the upload directories changed slightly.

/path/to/directory
became
path/to/directory

At that time I added a comment detailing the problem, and in the case of secure uploads I trimmed the path to not include that initial /

Last weeks changes involved expanding the comment, and removing the

if
statement. Both uploads now use the code that strips out the leading slash (actually rewrote it to not include the slash as opposed to stripping it out).

The ripples created from one small pebble dropped in the pond, manage to expand out to the very edges.

[‘ftp’ in quotes seems to be needed because of a bug in typo textile. ]

changed FTP to an acronym and textile doesnt have an issue with it.

Posted by Chris Clark Wed, 30 Nov 2005 08:06:00 GMT


IE bug (Comment Needed) Solved

Last week I mentioned that Rowan found a bit of code that didn’t display correctly in IE unless he included <!- Foo -> in his html. What was happening was the background color on two divs was not being applied, nor was the bottom border on an h2 being shown. If you selected the text, you could get it to display, or if you forced IE to redraw, by placing another window on top and then brought the document back into focus it would correct itself.

Today, with a lot of experimentation and code cleanup, I have managed to give him a simple solution. Here is the code we are working with
Initial display
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<div id="wrapper">
  <form action="">
    <h2 id="H2fir"><span>H2 with span for FIR</span></h2>
    <div id="div1">
      <p>
        <strong>Strong text:</strong><br />
        <a href="">click here</a> Secundum et, consectetuer haero esse sed premo foras at qui, saepius. Sino vel pecus amet saluto vulpes antehabeo ea sudo nutus, vindico.
      </p>
    </div>
    <div id="div2">
      <p>
        <strong>Strong text:</strong><br />
    Secundum et, consectetuer haero esse sed premo foras at qui, saepius. Sino vel pecus amet saluto vulpes antehabeo ea sudo nutus, vindico.
      </p>
    </div>
  </form>
</div>
and the css to format it is here
body {
  margin:0;
  padding:0;
  background-color:#FFF;
}

#wrapper {
  width:470px;
  position:relative;
  text-align:left;
}

form {
  margin:0px;
  padding:0px;
  border:0px;
}

h2 {
 font-size:140%;
 line-height:160%;
}

#H2fir {
  padding-bottom:0px;
  margin:0;
  border-bottom:1px solid #CCCCCC;
}

#div1  {
  padding:1px 15px 5px 15px;
  margin:10px 0; 
  background-color:#FEF5CC;
}

#div2 {
  padding:1px 15px 5px 15px; 
  margin:10px 0; 
  background-color:#FEF5CC;
}
Heres a link to this initial version with a screen shot . The initial fix Rowan came across was to add a comment in after the div in line 1. You notice that with the comment added #div1 and #div2 pick up their background-color and the h2 gets its bottom border to create a line seperating it from the content.
Comment Fix
1
2
3
<div id="wrapper">
<!-- Foo -->
  <form action="">
How he came to discover that a comment in that on space was enough to change the rendering? When he was initially developing the page he had commented the beginning and endings of blocks, so that he knew where in the specifications he was working. As it came time to deliver the work, he made a copy and started stripping out extraneous comments. This final version had the rendering error in it.

Today, I removed the css file, copied all of the relevant rules into a style block inside the document and went to work removing extraneous tags and wording, to produce the documents here. After removing the <!- Foo -> I started adding in items, I added a width of 100% to both #div1 and #div2, that gave us the desired results of having the background color, but both of those divs were then to wide, by the size of the padding. We could correct that by assigning them the actual widths, as calculated by subtracting their right and left padding from the width of their parent, but that forced us to change the width in 3 places when we wanted to change the parents width.

As I removed the widths from the divs, I also removed the background-color from #div1, that gave us the interesting result of displaying the background-color for #div2, but still no bottom-border on the h2.

My next guess was to add in position:relative to all three elements wich finally solved all of our issues, with the one problem, of it being a lot of work to add that in to every css rule that could possibly be affected in the original document. With a last what if we moved the position:relative up to the enclosing form and that solved everything.
Final CSS
form {
  margin:0px;
  padding:0px;
  border:0px;
  position:relative;
}

Posted by Chris Clark Tue, 15 Nov 2005 22:52:00 GMT


Tags

Going technical again. You are welcome to change the channel.

Last night while poking around with the front of this blog I came across an error in the tags functionality. Typo paginates content to 10 articles per page, and that works when reading articles from the front page, reading a specific months posts and even while reading based on categories. Where it doesn’t work is when trying to access all of the articles in a specific tag. The link at the bottom of the tags page has ?page=2 while everywhere else it uses the /pages/2/ notation. I have taken a quick look at routes.rb but I didnt see anything that actually handles the tags. it looks like the tags are being handed off to index

 map.connect 'articles',
    :controller => 'articles', :action => 'index'
  map.connect 'articles/page/:page',
    :controller => 'articles', :action => 'index',
    :page => /\d+/

I have also verified that it doesnt work on other Typo sites. I need to look into more of how ROR works, before I could begin to fix this though.

Posted by Chris Clark Wed, 21 Sep 2005 18:48:00 GMT


Bug in iCal

ical.gifI just pulled up iCal to check on a date. Notice the calendar —it is off by a month. It gives the correct dates for October, yet is labeled September. this is only in the small monthly view in the bottom left of the window. The main calendar has the dates correct.

Posted by Chris Clark Sat, 16 Oct 2004 00:19:00 GMT


Multiple Monitors

I got a new computer and monitor at work the other day, instead of getting rid of my old monitor, I am using it as a second monitor increasing my workspace. This is working great with one exception, when I move firefox to the second monitor, the menus continue to open at the far left side of the first monitor. This doesn’t happen all the time, so that when it does I restart firefox and go on my way with the menus displaying correctly.

Posted by Chris Clark Fri, 17 Sep 2004 00:49:00 GMT


Older posts: 1 2 3 4