Thursday, December 31, 2009

The end and start of a decade

Listening to the radio the other day it occured to me that this is the end of the 2000's.

I thought back to 2000 and what I was doing. I was writing C programs for DOS., writing batch files, reading Charles Petzold and Windows API programming, and playing with VB5 as a faster RAD development tool. I knew how to drag and drop the basic controls onto the form and that was about it.

In 2000 I started a new job. Working where I still work. I spent the rest of the decade learning and writing programs. I learned VB6 and earned an MCSD in it. I learned Transact SQL and SQL Server 7, SQL Server 2000, DTS. Perl, C#, and Java, Javascript, earned an SCJP.

I went from using my own copy method as source control to Visual Source Safe, to CVS. I've started playing with Git now.

I've started learning Ruby, which looks like the first language in the new decade that I'll learn. I've played very minimally with Rails and JRuby. Those will be right there too. But where will I be in 10 years, what will I be learning and doing? I don't know. I do know that I love to read and learn new things, so without a doubt I will definitely be learning new things.

Saturday, October 24, 2009

Override backspace as the back button

I have a common problem. I write a lot of web applications that run in a portal. When a user hits the back button it will take them to a different portlet or log them out of the portal completely. I can't prevent them from clicking the back button, but IE and Firefox both have the backspace key set up as a shortcut for the back button. This is annoying because the users will accidentally type it thinking that the cursor is in a text field. When it's not the back button is pressed and the user complains that they were randomly logged off.

To prevent this I use the javascript Shortcut.js and a small chunk of code.

shortcut.add("backspace", function() {
// override backspace as the back button
},{ 'type':'keydown', 'disable_in_input':true, 'propagate':false });

That's all there is to it.

Thursday, July 02, 2009

Tool tips thought

I don't know why it didn't occur to me before, but a tooltip does not have to be hidden when the link to hover loses focus. Especially if the tooltip should remain up for the user to interact with.

Instead ensure that the tooltip shows up where the mouse cursor is currently located, covering the underlying link, then hide it on mouse out of the tooltip instead of on mouseout of the initiating link.

Monday, June 22, 2009

clueTip zindex tip

OK, so the title isn't great, but that's what this is.

I had an issue where I'm using the clueTip jQuery plugin to show tooltips in my page. Everything was working great until I tried to show one inside of a dialog.

Even when I used the cluezIndex setting to show the tooltip and set the value to 3000 it wouldn't work.

$('a.toolTip').cluetip({cluezIndex: 3000, local: true, hidelocal: true, cursor: 'pointer', arrows: false, positionBy: 'mouse'});

After tracing through the code I found the problem. Once a tooltip is added to the page the cluezIndex value that it has stays the same, you can't change it with this setting.

For me, I made sure that all of my cluetip showings set the cluezIndex to 3000. Be sure to set the cluezIndex to a value that's higher than everything you want it to be above.

Tuesday, June 16, 2009

jQuery annoyances

Mostly I love jQuery, but there are few annoyances that I have struggled with.

  • I have not been able to bind a date picker to elements that are dynamically added to the page after load. This causes a problem.
  • The z-index did not allow the datepicker to show up on top of a dialog, I had to tweak the CSS to make that happen.

  • My element is stripped from the location on the page and moved into the dynamically generated dialog html element. this causes inherited CSS settings to be lost and the layout within a dialog must be specifically set.
  • Building the same dialog multiple times puts multiple copies in the DOM instead of cleaning up itself.
  • .remove() removes the dialog from the DOM by completely destroying the HTML, but it also destroys my HTML that was ripped from another location on my page.
  • the maxHeight value is ignored when initially building a dialog, and I have to check the height and specifically fix it if it is too big.

Thursday, April 16, 2009

Branching code for Development and test.

One of the biggest problems that's happened on projects that past few years was that web service changes that I was working on would break the UI that used it. This would cause testing to come to a halt until I could also add in the UI enhancements and redeployed it for test.

On the project that I'm working on now we're trying to implement some changes based on those problems.

First, we have set up a new web server to deploy a Development version of the web service to. This stems directly from the fact that new enhancements require changes to the web service and UI. The rules or additional features of the web service may break the UI until it is enhanced to take advantage of the new features. Having this new server now, I can break the web service and also use this development version to update the UI. When both are ready then they can be deployed for the tester.

Second, with multiple developers, sometimes one persons changes are ready to deploy for testing before the other persons. However, in an environment where everyone is using the main branch of the Source Code Repository (CVS for me) the code may not be in a deployable state due to one of the developers changes. In order to keep code synchronized with CVS, just in case my local hard drive dies, and have things in an easily deployable state, we are planning to branch each Story.

Timing is odd, it's something I was planning on doing, before I started implementing it I had the article The Story of the Branch Pattern sent to me. I'm doing basically the same thing.

Head is always deployable and the version that the Testers are testing. Defect fixes (unless they are very big) are done directly in Head so they can be redeployed quickly.

A new branch is created for each story. Development of the stories are done stand alone until they are ready to be tested, then they are merged in with Head and deployed for testing.

The only problem that I still have not figured out a way to work through is that this project has multiple developers. Each one is working on Web Service changes at the same time, and needs to have that web service deployed somewhere in order to make changes to the UI. We only have one development web server. Ultimately I think this could be fixed if I could figure out a way to get both the backend web server and the front end web server running on my local box. Each developer would then do everything locally until they are ready to merge. Until then I think the only solution is going to be to merge web service changes together outside of Head and deploy that merged version to the development web server.

Wednesday, March 11, 2009

Ultra Edit is coming for Linux and Mac

Ultra Edit (my favorite editor) is finally making a version that will run on Linux and Mac.  I think that this is a very telling step.   It may mean that software makers are finally feeling that Microsoft is losing it's grip on the OS.   

Even without some of the more popular pieces of software being available for Mac, and to a smaller extent Linux, people have been switching away from Windows.   

If Software Vendors update their applications to work on these other systems, I expect that even more people will be willing to make that leap.

Thursday, March 05, 2009

Book Review: The Little Book of Ruby gave away the free book The Little Book of Ruby and I took advantage of it. Due to some things I was working on I had to restart the book several times. Now that I've finally finished it I thought I'd write up my thoughts.

The Little Book of Ruby does a decent job of explaining the very basics of Ruby. It does not delve into detail or give best practices on things, however, it's enough that a Ruby Beginner can read through the 85 page eBook and be able to figure out mostly what's happening in Ruby code that they look at.

It's a better start to Ruby than Why the Lucky Stiff's into. Why is an interesting character, but he gets too sidetracked, The Little Book of Ruby is a much better starting place.

Wednesday, March 04, 2009

What I'm up to.

Off and on for the past year I've been trying to pick up Ruby. Last year I ended up getting sidetracked specializing in some Java code. However, since December I have been a reading machine and plowing through books. I've started absorbing everything I can about Javascript and jQuery. Now I'm also Reading about Ruby and Rails and JRuby.

I plan to have some posts coming up from things that I have learned and played with recently, and that I'll continue to work with.

Thursday, January 08, 2009

Almost as good as code reviews.

Right now code reviews seem to be what everyone is pushing. TDD is good, but code reviews are better. I recently read "Best Kept Secrets of Peer Code Review" which says about the same thing.

Code reviews can be hard to come by. Some companies just don't want do dedicate the time to doing code reviews.

However, something that is almost as good as code reviews are tech sites like Experts-Exchange. These sites will not find the flaws in your programming, but one of the benefits touted by code reviews is that they help you learn new and better ways of doing things. These forums for problems and questions that people have do the same thing.

If you can't do code reviews, I suggest finding a site that deals with questions of the system that you work in and join, participate, ask questions, and watch what other experts post. You may learn some junky way to solve problems, but one thing that seems to be universal in programming. The people who are really good at it, like to help others. That's why they write books, blog, and participate at these sites.

You may be thinking, but I can just follow blogs to see what's going on. That's true, you can and should do that too. But the forums that are open for anything are where you find people asking questions about how to do something that you never even though to attempt. And while you may not know the answer, you'll likely be able to read the wisdom of someone else that already struggled through it. Don't wait until you have a question that you can't answer, find out what questions others can't answer, and the answers that are given to them, become knowledge for you. You won't even get to the point where you have to ask the question because you already know the answer. And some of the oddball questions, may open your mind to providing an entirely different solution than you had ever considered before.