Time to divulge in a little code issue here. I’m currently working on cleaning up the defect backlog of one of our largest products, and we’ve made more extensive use of jQuery in this application than we ever have before (and for one, I think it’s GREAT!), but it’s also caused us to hit some weird problems that we’ve had to work through.
We’ve been using the great Table Drag and Drop jQuery plugin to deal with reordering quickly and easily in the application. There are a number of pages that implement it, and admittedly, I’m not the one who initially set them up. We had a bit of an issue with the C# codebehind on all of them not properly processing a move from the 1 position up to the 0 position that I had to fix, and was able to do that (after some weeping, wailing and gnashing of code), but this one page refused to even get to the codebehind.
Everything worked fine except for when I moved a row from the 1 to 0 position, and I would get a javascript error that said:
prev().0.id is null or not an object
If I’m honest, not the most revealing of errors (though once I figured it out, it told me exactly everything I needed to know:)). So, I dug through the C# code on each, which was identical (except for variable names), but I was pretty sure that wasn’t the problem anyway, as this was a javascript error being thrown, not a page error.
The jQuery call was exactly the same:
1: function onDropItem(table, row) {
2: var curPanelId = getPanelId();
3: PageMethods.Reorder(curPanelId, $(row)[0].id, $(row).prev()[0].id, onSucceeded, onFailed);
4: $(row).highlightFade({ color: 'rgb(255, 241, 168)', end: '#fff', speed: 1000, final: "" });
5: }
So, it couldn’t be the client side code. The problem, it turns out, was in the markup. In both cases, the rows being moved are contained in ListViews, but I discovered a difference between the two. In the ones that worked, there were no XHTML proper <thead> and <tbody> tags to delineate the rows of the table. In the one that was broken, there were.
Time for that DUH moment when I realized that what was happening was that because of the <tbody> tag, there was no previous table row in the DOM for the jQuery code to access, so it was returning a null row, hence the error.
Now, admittedly, I fixed it by going the easy route and removing the <thead> and <tbody> tags (and it works perfectly now), but I know there’s a proper way to handle this with the tags left in, I’ll just have to play with it.
I Binged (yeah, I said it) for this error and found nothing online, so maybe if somebody else runs into this problem, this post will be helpful. If so, please leave me a comment!
Last week, I was reviewing classified ads on Craigslist, an activity I undertake on a relatively frequent basis, as I like looking at what cars are available so I can drool in private… One poster had put a message in his ad specifically targeted at the Craigslist scammers, which seem to be rather prevalent in the autos for sale arena. Essentially he said that he didn’t even want to post on CL anymore because the scammers irritated him so. Having posted a few vehicles on CL in the past few months for sale, and having been the recipient of a few scam offers (one of which went so far as to send me a bogus cashier’s check), I can understand his fury.
I think though, what irritated me the most is that scammers are taking away an important piece of life, or at least, our outlook on it. That piece they’re taking away is hope. And here’s where the second half of my title comes into effect. I tend to think the best of people. I tend to be overly trusting. I think that probably has something to do with the fact that I hope that people are generally good. I hope that when I deal with somebody, they are being honest with me, as I am being honest with them. And LUCKILY, I’ve found that seems to be the case with the people I’ve dealt with on Craigslist in general. We’ve sold 2 cars, an XBOX 360 and a Wii gaming system lately, and in all cases, the people we’ve sold to have been extremely fair. I hope that I have been seen as fair in their eyes as well, because I try to be.
Unfortunately, there are those people out there who are trying to make a quick buck, and are willing to destroy their reputation (and the reputation of other unknown people) by taking advantage of other people. My wife tends to believe most people are of this ilk. Granted, she’s lived a harder life than I have and has run into more of these hope-stealers, so that may color her outlook.
Nonetheless, something we seem to be missing in this country, especially over the last year, is hope. There are those who wanted very desperately for Barack Obama to be elected President, because they thought he represented hope for better things. Honestly, even though I didn’t vote for him, I still hoped that he would be a good President and lead the country well. The jury is still definitely out on that, but I think the rejuvenation of hope was a positive thing.
I think hope is fundamental to happiness in general. As I go throughout life, I find that those people who have hope for a better future, whether in small things or large, tend to be happier. They have a reason to be happy, for they have hope that things will be even better in the future. There’s a step then to be taken from hope to faith. Hope is the cornerstone of faith. The scriptures tell us that faith is to “hope for things which are not seen, which are true.” That hope helps us understand that life is much bigger than just today, and that we can shape our tomorrow.
If you look at children, one of the key things that make them so happy and full of life is that they are FULL of hope. I hope that I never crush my children’s hope by telling them something is impossible. They need to have that hope to make it through these tough times. They need to have hope that the people that they encounter are typically good people and hope that they will be positive.
So scammers, quit stealing peoples’ hopes. Quit making it so frustrating to do business with each other. Quick being the kind of people my wife thinks populate the earth.
Fourteen years ago today, I entered the Missionary Training Center in Provo, UT to become a representative of the Lord Jesus Christ. I would serve 23.5 months in the Massachusetts Boston Mission, and I would have my life changed forever. It truly was a life-changing experience. I remember preparing to enter the MTC and saying goodbye to my then girlfriend. I thought that was the toughest thing I’d have to go through. Little did I know.
Those 2 years in service to God, my life’s tithing to that point, changed who I am in many ways. It helped me understand the gospel, and really understand that the gospel more than just a set of rules and guidelines. The gospel literally translates to Good News, and that’s what I realized. It was the good news that Christ came to earth of His own choice and will. It was the good news that He was born in the humblest of circumstances, in a manger, in a barn, surrounded by lowly animals. It was the good news that He truly lived a perfect life, and through that life, He showed how we should live. He showed that we should love one another. It is the eternal good news that He atoned for my sins, even the very sins of every man to walk upon the earth, so that he could be our Mediator, our Advocate with the Father, and our eternal friend. It is the further eternal good news that He offered up his own life, so that He might taste death, that He might have power over the grave, and that He might offer that free gift of resurrection to all men.
It is the good news that He did rise on the third day, and overcame death. He setup His church on the earth that those who would follow Him might have the authority to act in His holy name. It is the good news that His church was restored to the earth after the great apostasy, and that He once again speaks to his prophets here on earth.
It is all good news, great news even. It is plain, it is precious, and it is joyous. In this spirit of Christmas, I am reminded again that His birth cannot be separated from His eternal mission and His eternal purpose. When we celebrate the birth of Jesus Christ, we should celebrate His life and how He lived it. We should celebrate the love that He showed us, and share that love with those around us. It is the time for us to reflect that eternal light that He is to others.
I learned that lesson over two years in service of both Him, and the beautiful wonderful people of Massachusetts. They changed my life, I hope I was able to change some of theirs by sharing the most precious gift I have; my testimony of the Savior, his life, his mission and his good news. I hope the good news will lift your spirits and your lives this Christmas season, and that the joy of Christ will radiate throughout your homes.
I’ve been seeing an ad campaign (in print, at least) running in Car & Driver, Motor Trend and AutoWeek lately for GMC Trucks, specifically the new Terrain. I’ve tried to find it online, but for the life of me, I can’t find it right now (and honestly, I’m too lazy to scan it…). Anyway, it says (in essence): We gave it more, because more is what we do.
That ad campaign really hit me, but fore the wrong reasons. Given that GMC Truck is still (via the parent company of General Motors) owned in large part by the United States government, maybe they should rethink that approach. After all, everyone can pretty much agree that doing “more” is what caused them to go bankrupt in the first place.
My suggestion to General Motors would be not that they focus on doing more, but focus on doing BETTER. GM’s car quality has been steadily falling over the past 20 years, to the point that many of their current vehicles are a sad punchline. I have personally owned only one GM car myself (see the previous post), specifically, a 1993 Pontiac Bonneville, that after only 10 years suffered from an interior leak, brittle plastics that broke, and a 3.6L V6 engine that was ANYTHING but inspiring. After I disposed of it, my friend that I cast it off on had recurring issues with the intake manifold gasket, largely due to the fact that the intake manifold was a composite piece, before they really figured out how to do composites in engines correctly.
Their current line-up, with the notable exception of the halo cars like the Corvette ZR-1 and the Cadillac CTS-V, is not inspiring to me either. Maybe I’m not their target demographic, but as a 34 year old male, I would think I should be. They tried to target me with the Camaro, but it’s a sad, also-ran, far-too-late attempt to cash in on the success of the retro Mustang and Challenger. Saturn, the line that actually appealed to me, due to a wealth of European Opels rebadged, is dead. Pontiac, who at least had a little excitement, is dead. (Oldsmobile, well, good riddance…) Buick has absolutely, positively nothing in their range that speaks even a little bit to me. Chevrolet has piqued my interest with the Cobalt SS, but my understanding about that car is that while it’s a blast to drive, it’s not particularly well made. The Impala honestly looks look a good car, and a good value, but at this point, I’m kinda skittish about the quality.
Perhaps I’ve been watching too much Top Gear; okay, I’ve always been watching too much Top Gear, but this ad campaign is, to me, a microcosm of why GM and Chrysler are both in so much financial trouble, and what is wrong with the typical American psyche. Our country’s motto could well be “because more is what we do,” especially when it comes to our vehicles. Bigger is better, right?
There are some pundits in the automotive media forecasting that we will soon follow the Japanese and Europeans in desiring smaller cars. That certainly happened when gas prices hit the roof last summer, but as soon as gas dropped back below $3/gallon, SUVs got gobbled up again. I think it will take gas getting back up to near atmospheric levels for a sustained time to see that reality happen. I’m not a hybrid fan, at least as far as it is used in the Prius or Insight, but at least they are smaller cars.
So, my open letter to GM is this. The Volt is a great PR attraction, but the skeptic in me says you’ll find a way to screw it up. Ford has already gotten the clue and has started putting smaller turbocharged motors in their cars, and is getting ready to introduce the Fiesta to America. Chrysler, thanks to Fiat, will have the 500 here in two years. Those are two examples of well-made fun little cars that could be the leading edge of a change. The Aveo/Lacetti just is NOT going to cut it compared with those vehicles. The small cars you showed last year and teased everybody with are what you need to start building for America. Put a 1.3-1.5L Turbo motor in it, make around 140hp, keep it light and make it fun, and you’ll attract more young people. And in case you hadn’t noticed, your Buick demographic is dying, literally. I hope you can figure it out and turn it around, because for one thing, I’m footing the bill for your screw-ups. The first step is to figure out that MORE shouldn’t be your calling card. BETTER should be.
I’ll be the first to admit, kind of a strange subject. As I drove into work today (listening to the Car Talk Pod Zunecast, I thought back to something one of our friends said when she first saw my “new” car, a 1988 Saab 900 SPG (SPG = Special Performance Group, it means it has a tweaked suspension, 3 spoke Ronal wheels, and a custom body kit). Mind you, I’ve wanted an SPG since my youth, because I thought the body kit and the wheels were just the business (to quote TopGear).
But then I thought about my car history. My first car, a 1984 Ford Escort, with a stick, was one of the last times I really ever owned a car without something special. Without, what my friend Becky called, character. Character? In a car?
Yeah, as I’ve looked back over my car history, character is what they all (since that Escort) have in common. Here’s the rundown:
So that’s the story. I looked at buying “sensible” cars, like a Camry, or Accord or what have you, but they just don’t fit me. They don’t have the kind of character I’m looking for. I’ll probably always be that guy who drives the quirky older turbo-charged car, because I care more about character than just getting from point A to point B. I can do without the creature comforts of newer cars (like AC, etc.) because I want to drive something that honestly puts a smile on my face every time I drive it. If life truly is an adventure (and I believe it is), then shouldn’t you enjoy the trip?
Got a bit of a wake up call this morning when I went to deploy a new WCF Service to our internal web server. We’re going to use it for an external Resume Database to talk to, but initially it will be internal only. Well, what I found out, rather rudely, is that if you assign multiple host headers to an IIS site for WCF, you’ll get this rather unfriendly little error:
This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Essentially, it’s finding more than one item to bind to, so it freaks out because WCF doesn’t support multiple IIS bindings for the same protocol. There is a work around, which is to create a ServiceHostFactory, about which more information can be found here: http://msdn.microsoft.com/en-us/library/aa702697.aspx
Maybe that’ll help me remember to do this when I switch this to an external WCF service…
First, what a great past 3 days! devLink 2009 was a raging success in my opinion, and from what the Tweetiverse says, it was well enjoyed. I had a great opportunity to volunteer and assist with the logistics of the conference, and a great opportunity to work with some great people which probably taught me more about life than any of the sessions could have possibly taught me about development.
Still I attended some great sessions, the notes of which are previous posts here, though there are others I attended that I didn’t take notes on, one of which sticks with me. Rob Windsor’s session on LINQ and the functionality that makes it possible in .NET 3.0. He gave some really great examples of Type Inference, Lambdas, etc., and it was a great consolidation of all the great new technologies that work with AND independent of LINQ.
But the one “session” I haven’t been able to get out of mind is the final session of the conference which was a panel discussion recorded for Dot Net Rocks which will soon be released. The topic of the discussion was, “Has Software Development Gotten Too Complex?”
I took the opportunity to add a comment to the discussion, in which I expressed my opinion that the root of the problem with software development complexity lies in the developers themselves. As a developer, I’m as guilty of this problem as most are, so I know all too well that developers LOVE to make simple things more complex. Essentially, I said that ego is a large part of the problem with software development being too complex, in that we developers enjoy making things appear more difficult than they really are, so that we can appear to be more important.
I want to expand some thoughts in this area in this blog post. I speak from my own experience as a developer, as well as my experience managing other developers, and working with other developers. We all like to be superheroes. We like to be seen as great problem-solvers who have the ability to fix anything that comes our way. Just like anybody on earth, we have a need to be important.
Unfortunately, that need to be important, and the need to fix problems tends to give us a “hero complex”. That hero complex then leads us to making simple problems more complex. The interesting thing is that as the tools we use become better and more refined, thus making it easier to fix those simple problems, we then compensate by increasing the underlying complexity. In order to take care of our egos, we then project that complexity on to the business units that need us.
We aren’t alone in this ego-based complication of simple problems. Project managers, CIOs, business analysts, etc., are all guilty of overcomplicating the issue. Government officials have turned red tape into either an art form or a science.
So, how do we fix it? How do we make ourselves stop being a big part of the problem of complexity, and start making it easier for those businesses that rely on us to actually solve their problems?
I’d like to see your answers and comments, and in the next week, you’ll see mine.
Presented by Jeff McWherter – Web Ascender
Formal CTPs and documentation @ www.asp.net
Cutting edge drops, roadmaps, etc @ www.codeplex.com/aspnet
VS10 supports multi-targeting, can support 3.5, 2.0
FX4.0 maintains a high compatibility bar with FX 3.5, they’re really trying to make it a much better experience than from 1.1 to 2.0
VS10 – no more WinForms, now WPF rendered interface improving UI performance
Out-of-band releases (MVC, Dynamic Data, etc) rolled up into FX 4.0
ASP.NET 4.0 Themes
Web-Forms
Ajax
ASP.NET MVC
ASP.NET Dynamic Data
Back to the ‘core’
Presented by Matt Casto (http://google.com/profiles/mattcasto)
There are many different ways to write regular expressions to achieve the same result. Examples at http://www.regexlive.com
http://del.icio.us/mattcasto/regex for informative websites.
Stephen Cole Kleene invented RegEx using Mathematic Regular Sets
Ken Thompson used regular sets for searching in QED and ed
grep – Global Regular Expression Print
Henry Spencer wrote the regex library that Perl and TCL languages used
Why Should You Care? Find duplicate words in a file
Using regular expressions reduces from 30+ lines to 5 lines of code
Mastering Regular Expression by Jeffrey Friedl very good for examples
Use System.Text.RegularExpressions for .NET help
Literal characters
Special characters
Presenter – Kevin Kline (Quest Software)
What is Virtualization?
Benefits of Virtualization
Drawbacks of Virtualization
Strategies
Licensing Complexities
Virtualization Performance
Best Practices for Virtualization
riceboyler is actually Jason Clark, a father of three wonderfully crazy children, husband of one crazily wonderful wife, ASP.NET Developer, Certified ScrumMaster, Latter-day Saint, and sometimes I actually do some things I want to do. :)