Friday, September 26, 2014

Day 10: All Fridays aren't Beer Fridays?

Sad news at work today. Not all Fridays are Beer Fridays.

I'd gotten in a little later than all the other days of the week, stopping by Starbucks first to welcome in the rainy season. It was still about 9:30 when I sat down and fired up the MacBook. 

When Tracy got in we ran my database updates that I'd written and tested yesterday. Then we found another ticket for me to work on.

The issue was occurring in the admin view of a management tool. They are presented with a list of courses, and should be able to click on any name and have that space become editable, so they could change the name of a course right there. The problem was that the editable option went away if they deleted the name and saved it. However, this was an issue the team thought they'd fixed a while back. 

I pulled that ticket and looked at the revision to the code, so I'd have a starting place. After some experimenting, I realized that the problem was caused not by deleting the existing name, but by replacing it with any number of spaces. (A lot of folks highlight a field of text then hit the space bar to "delete" it. This doesn't delete it, it just replaces it with a white space character, therefore creating a non-empty string.) 

Regular expressions it was.

It was a simple and straightforward fix once I understood the problem. Very cool.

After lunch I picked up another ticket. This one has me a little stumped. Sorting in PHP is not the easiest thing in the world. Especially when you have French-speaking clients and have to be able to include all sorts of alphabet characters in your sorting abilities. Then there's numbers. You'd be amazed how many sorting algorithms sort 1, 10, 11, 12, 2, 20, 21, 3,... instead of 1, 2, 3, 10, 11, 12, 20, 21. 

That's the problem here. The numbers aren't lining up right. Only, I'm not sure where the data is being sorted, or if it is being sorted at all and not just dumped nilly-willy from a database. This one will take a little more digging once we get back after the weekend.

Around 3 pm I realized I hadn't heard anything about Beer Friday yet. I was mostly just looking to leaving a little early and heading home. As the minutes turned into half hours, I figured out that we would indeed be in the office, working, until 5 pm. Alas. Life is a struggle.