Pencils Down

This weblog is about my experiences in software development

Browsing Posts in Uncategorized

Recently our smaller sized project went through a final test cycle (with customer reps present!).  So, of course, for the last two weeks we have been flooded with feature requests that “have to” be done for this release.

Any discussion about whether this was a good idea or not was thrown aside:  “The customer made this request.”, “It has to work this way or we can’t release”, etc…

There has been a recent change on the test side of the world, but that person has many years of doing this under their belt. Similarly at upper levels of management of the project: they all have many years of doing this. Yet, somehow, lots of features show up at the last minute with little to no documentation as to actual requirements or needs.

I guess I should be used to this (having many years of doing this myself), but I am always flabbergasted.

And of course, the testing did not go well.

I have a screen with a series of commandButton’s. They all should call various action methods back in the controller. Some of the command buttons used images – they worked. Others just had values for the buttons – they did not work.

Adding onclick showed the buttons were working, they just were not calling the actions.

Several misguided google’d references mentioned changing the behavior of the ui callback setting in web.xml. I tried that and it made no difference.

Finally I noticed that I was missing the id attribute on the buttons. Adding different id’s for each of the buttons fixed the problem – the buttons now invoke the methods as expected.

I had thought that icefaces added default id’s where necessary, but there may be a glitch when you have an assortment of fields of the same type.

In ASP Classic you can define an object using syntax like “public class X” and define properties and getters and setters. This is fairly common practice and attempts to bring the scripting language to approach an object oriented programming point of view.

I recently ran across the need to stuff these objects into the session for later retrieval. The interesting thing is the code to add the object to the session and retrieve from the session appears to work without any error. The only error occurs when you attempt to access any method or property within the realized object.

After some digging it looks like this is a planned feature from Microsoft. I guess the thinking is that the ASP engine can not guarantee there is a type definition around (the ASP page that defines the class), therefore it doesn’t really do anything with your session operations.

My alternative was to serialize the object and store the serialized version in the session, something like:
class X
public var1
public var2

public Function toString
toString = var1 & "~" & var2
end Function

So, we can have code to store the ‘object’ in the session like:

Session("myobject") = oX.toString()

Later we can retrieve and realize the object using the reverse code:

Set oX = new X()
X.fromString(Session("myobject"))

Where fromString is defined as:

class X
public Sub fromString(s)
Dim array
array = Split(s,"~")
var1 = array(0)
var2 = array(1)
end Sub

It’s a pain to add the serialization code to your ASP classes, but it works fine.

I would like to call your attention to what I am calling “Temporary Social Webs”.  These are social webs that only exist for a short period of time that are used for some social purpose.  I have been involved with two in the last year:

  1. family members to post notes about recovery from an operation I had
  2. one of my best childhood friends died and the local paper provided a site for talking amongst people that remembered him

Like other social web sites there are a lot of fairly random contributions, but I think the significant points are:

  • the contributors are not usually very computer savvy
  • the contributions are only maintained for a short period of time.
  • this is more than just commenting on an article, as the contributions are coalesced along the subject over a time

The operation recovery site is http://caringbridge.com.  It is little more than a blog, but I number of my family members are not great at computers, so there involvement is tremendous.

The deceased site was from the http://boston.com.  The site was maintained free for 6 months and expired.  There was an opportunity for someone to pay for the site going forward, but I don’t think that occurred.  I think the site helped and met its goal of helping us to remember our friend.

I think there is a tremendous opportunity to explore other uses of Temporary Web Sites, maybe prompted by marketing requests or the like where people are directed to a site that will help them do something socially for a short period of time.

Spring has the ability to provide for Asynchronous processes to run. This would typically be used for some kind of status updater that has to circulate your database to determine if the change a user just made has had any effect on the rest of the system. This is normally not a very quick process, so you would naturally want to throw it over the wall to some asynchronous process that may tell you when it’s done.

This all works pretty well. You just have to tag the method in question with the @Asynch tag. You can still do things like synchronize the method call so that only one of them is running.

The tricky part is how to pass over the credentials of the user that started this all occurring?

If you have a typical MVC implementation for your app, you have gone through some pain to determine that the current user has the rights to exercise some feature that results in an asynchronous process kickoff. But there is no apparent mechanism for passing over the user ‘session’ information over to that asynchronous process. This means your asynchronous process has to run in its own vertical stack, not sharing results with anyone, including the user who kicked the whole thing off in the first place.

This appears to be a flaw in the design: While it is extremely useful to kick stuff off that runs elsewhere and does not tie up the user, there needs to be a connection maintained back to the user thread.

Any useful suggestions here?

Web Site Ransom

No comments

Some really nice person recently hacked into my server and adjusted several of the sites there (on a shared, hosted environment). You expect this kind of thing with the typical “Ha, Ha” splash page instead of your painfully developed landing page. The interesting aspect was the hacker took the original index file and substituted their splash page with the message “Contact me to get your index page back”.

So, assuming you had developed your site using PHP. You would have likely placed most of your logic in an index file and use .htaccess to allow for nice, SEO URLs. Now, you get a hacker come in and steal your index file. The index file probably covers 90% of the web site functionality. If you don’t have a backup somewhere what do you do?

• You can’t really contact the hacker (Assume the hacker splash page has a bogus email account).

• Even if you did manage to contact them do you think they would do (four letter word coming) WORK and save off your precious index file vs. just replace it with their slime? They are probably praying for someone to respond to their handiwork, promise them, “Yes, I will give you index file back as soon as I get a PayPal payment of (exorbitant amount goes here)”. Knowing full well there is no index file being held for ransom.

Seems like it would be interesting to provide a “site watcher” type of application that just watches all of the files on your site and notifies you of any change in real-time. Maybe it even allows you to put the old file back as part of the message sent to you. (Please forward me a nice donation if you take this idea)

The Massachusetts appliance rebate program went into affect last week. The state gave away over 6 million dollars in a few minutes. Consumers had to register at a government run web site for a coupon and later go to a store to use their coupon. The site crashed within minutes of opening. Call center volumes were in the many thousands.

A local radio station, WAAF, with a particularly Republican bent went on air lambasting the whole process. Included in the rambling was mention that:

  • The government employees involved should have been able to better guage the resp0nse.
  • The web programmer(s) involved will probably not be held accountable
  • They developed a back-door website which could be used during failover, but did not publicize it’s existence

The station really appeals to working class, blue collars in the eastern Massachusetts area.  Several callers dialed in their similar belief of the points above.

I think this episode marks some common perceptions of (web) programmers:

  • They can accurately measure/estimate web usage
  • They have the tools and know-how to make a site like this work
  • Scale is not really a factor – they could have made this work
  • Putting in a back door is just another hacking incident – they expected the site to fail, but wanted a way to provide access to selected insiders

Overall, it makes programmers sound very sinister; lacking morals; careless about the effects of their craft.

I wonder if the people that did this have any idea how badly they have maligned the industry.

Wikipedia defines ageism as “stereotyping of and discrimination against individuals or groups because of their age”.   I know we all think we are still the hotshot twenty-something programmer just out of college, but reality is a little different.

There is a programmer on our team that has 20+ years into the company. Unfortunately, most of that time was spent on archaic versions of C on non-standard operating systems. BTW, the system in question is still in use in the field.

The problem came up when she transferred to our team. We are all Java, fairly leading edge type of stuff. She had a very hard time coming up to speed. It got to the point where she has been placed doing non-programming assignments for the team.

I think this has more to do with her age than anything else. I know she is just as much at fault for not keeping up with the industry, even as other projects in the company started to embrace Java. I also think the company is at fault for not pushing her in the corporate direction sooner.

So, now, on the surface, it looks like an older employee is being pushed aside. It sure smells a lot like ageism.

This is a really ugly exception thrown by Oracle from the bowels of Hibernate. In my case I had just added a table to the mapping so I at least had some idea where to look.

Looking at the integer values in the table I went through and verified each as correct in the db, mapping, entity and sequence. No luck there.

Poking around the internet though told me the error probably had nothing to do with a LONG mapping and could be ANY size mapping on any field. It’s a generic sizing error.

Luckily the table I created only had a few fields so I was able to narrow done the problem pretty quickly. In my case a VARCHAR2(4000) was attempted to be stored with much more. So, the String in the Java entity had to be controlled to make sure it was small enough.

It’s not much, but thought I would pass the info along and maybe save you some time.

It occurred to me the other day that a big project is doing the Wrong Thing the Right Way. So, their process is great, but the project is dying off because they are doing the wrong thing, e.g. not meeting performance goals.

You would always like to be on a project doing the Right Thing, the Right Way, but I don’t get the impression that happens very often. I wonder if it’s just a matter of resources. Upper management is in the typical three-point dilemma: time, resources or features and skimps on at least one.

To fill out the matrix you can be on the Right Thing being done the Wrong Way. This would be a good project, but you aren’t following any rules. I think many successful companies work this way: get it out the door, now!

Then there is the worst case: Wrong Thing the Wrong Way. This kind of project is a killer: try as hard as you can and nothing is ever correct. Worse I think such projects put a big scarlet letter on you for the duration of your employment at a company.