Pencils Down

This weblog is about my experiences in software development

I recently ran across the error “unable to find parameter [x]” where “x” was clearly defined in the list of parameters for findByNamedParam.

My first step was to remove the parameters and just try to grab the whole table, something like “from mytable”.  This resulted in “no persistent classes for query class”.  Again, the classes definitely exist and are correctly referenced in the mapping.

Then I re-added the hibernate mapping xml file to the project config.  (It was already mentioned, but appeared a little different than used successfully elsewhere so I clobbered the whole mapping section and re-entered it).  This resulted in a number of syntax errors in the xml file.

Once the xml syntax errors were cleared up I was able to retrace the coding to correctly locate the records of interest.

So, whenever you get a message from hibernate that is even remotely vague assume something else is wrong that it forgot to tell you about, but it is being nice enough to tell you something is wrong.

Share

A recent article talks about a software company’s reasoning for bucking the trend of responsive design.  Responsive design to me means have one user interface that works for any display size.  Interesting idea.

In a previous instance that I worked on we had a fairly complete web application developed with different categories of users.  Maybe 75 pages.  Since this was prior to “responsive design” we went through the application and cherry-picked the items of interest that would make sense on mobile devices.  I think there are about 15-20 pages on the mobile version of the app.  This seemed like a reasonable approach.

In the author’s reasoning the first item was “expected mobile usage”.  He provides a pretty low number (2%).  The mobile version of the app we developed has been live for about a year.  I think the percentage usage for us was much lower.

Now we are coming up with another web application.  Since responsive design is all the rage, guess what we are doing?  There are a couple of sample screen shots that run the vertical length of the page and have been scaled to fit in a standard page.  That means we can expect mobile pages to go on for 3, 4, 5 mobile screens?

I guess it feels like another trendy thing to do in the programming world: you have to do it or people think you are inept.  Just wonder how long it will take to go away.

Share

That is the title of a recent article in the NYT.  The author talks about his experience with New Guinea natives who refused to camp under dead trees.  The reasoning being that there is a 1 in 1000 chance of one falling over, I sleep under trees every night, if a tree lands on me it will kill me, the mathematical likelihood is 100%.

The author uses another example of taking a shower (hence the name) and it’s likelihood for older individuals.

I started to think about computer stuff.  If you think about some of the systems you have developed or used you may have similar concerns:

  • that disk drive that has a 0.01% failure rate
  • the expected occurrence of a divide by zero
  • neatly computed mtbf for that system delivered

All of these fall into the same case:  with large numbers any percentage greater than zero will cause a failure.

Currently working on student course selection software.  It has been painful dealing with the number of special cases that have to be hacked into otherwise pretty good looking code.  Why on earth do we care about these odd cases?

Using the above logic, “any expected failure will occur” in this case with a large number of students over a period of time, it becomes clearer – the system will fail.  It is just a matter of time.

Share

Interesting database performance article from instagram.  The article focuses on their use of Postgres, but a couple of the key issues that are likely portable to other databases:

1. Partial Indexes to avoid massive collisions on meaningless data.  Create index like:

CREATE INDEX CONCURRENTLY on tags (name text_pattern_ops) WHERE media_count >= 100

2. Functional Indexes – same idea to avoid non-useful indexing

CREATE INDEX CONCURRENTLY on tokens ( substr(token), 0, 8 )

I have not dealt with big data, but making indexes work to specifically ignore useless aspects sounds like a great idea that I will be using.

Share

I had been using a supposed feature of HTML where I redirect a user back to a page, like ‘http://www.site.com?key=5#38′.  Assuming the hash code (38) would be interpreted by the browser and paint anchor 38 on screen.  This works fine for in page anchors.  It does not work for page loads.  The browser will display the hash, but completely ignore it.

I tried various methods to attempt to scroll the user to the correct place on screen, but the offsets never came out quite right.

Last thing I tried is something like:

  1. user clicks button or link that would bring to a different page
  2. jquery click handler grabs the current scroll bar position and sets in session variable using an ajax call to remote function
  3. user does whatever on other page and eventually is brought back to page of interest
  4. at bottom of starting page we check if the session variable has a value, set the scroll bar position accordingly, and remove the session variable

Appears to work pretty well.

All of the DOM calls are done using jquery; as is the ajax call to set the session variable

Share

Interesting article at http://highscalability.com/blog/2012/12/10/switch-your-databases-to-flash-storage-now-or-youre-doing-it.html.  Gist is to put the database on a flash drive.  Massive performance boost at cheap cost.

I have done similar one-offs putting database on a flash drive, faster drive; using in-memory database apps.  Sounds like the logical next step: just put the entire thing on a flash drive.

Share

How many programming tools have you tried using that really didn’t quite do what they were supposed to do?  Well, you are in luck!  BlazeMeter works!

You can sign up for a 7 day free trial at blazemeter.com.  Just upload you JMX file and you can be running in minutes.  We had a particular problem where the test script was running on a developer machine and was hampered by whatever happened on that machine: memory swaps, priority alerts coming up, developer doing something useful – while the test was running.

With blazemeter your script is distributed amongst a set of cloud servers with ultimate bandwidth and memory and you see none of the issues.  In our case we ran across a consistent 30% failure rate dropping down to 1%.

The only trick is that you have NO interaction with jmeter.  Everything your script needs has to be in the local directory with the JMX file.  In our case we had a CSV file for user ids.  A small change to the script to not specify the path of the CSV file worked easily.

More interesting was providing the jks file and the password to access.  Using the user interface you would normally just specify the jks file using the menu option.  There is no jmeter UI when your script runs.  All that info has to be provided using a system.properties file (in the local directory), like:

javax.net.ssl.keyStore=keystore.jks
javax.net.ssl.keyStorePassword=password

The site/tool does provide a really interesting graphical display of the characteristics of your test.  You can dynamically change the axes displayed using buttons on screen.

I have to tell you: when I first ran my script I really couldn’t believe it worked so easily.  Such a treat to do the expected steps (above) and the thing just works.

If you decide to go forward and pay for use it’s very affordable.  Again, just the ease of use makes life so much easier.

Share

Historically companies have laid off contractors before employees.  The idea was that they cost the most.

Under Obamacare I think things are reversed: employees cost more than contractors.  Several firms had already announced layoffs if Obama got re-elected.  They have already determined that the differential pay for a contractor is LESS than the total, benefit laden cost of an employee under Obamacare.

Imagine you are an employee of a larger, older firm.  Even worse, imagine you work for one of the companies that pre-announced layoffs if Obama got re-elected.  What do you do?

I think we may see a resurgence of agencies that hire these laid off employees and place them back in their old companies as contractors.  As I remember, that was really not such a nice place to be when it happened several years ago.

Interesting times.  I wonder how it will really play out?

Share

Someone on craigslist made this excellent post:


Date: xxx
Reply to: xxx


Designers do.
Photographers do.
Graphic Artists do.

Web developers create software. Something that does something. Think Verbs.
Most successful developers work on projects that are not open to the public.
Even with the public facing sites we work on, the look and feel is not typically done by us. It’s done by a designer.

If you’re not getting good replies to to your ads here, try taking out the ridiculous insistence that developers send you a portfolio of their work.
Ask instead for a resume, CV, or description of their work.

  • it’s NOT ok to contact this poster with services or other commercial interests
  • Compensation: no pay

PostingID: nnnn

Share

Assuming you go through the standard steps:

  • run eclipse with the -clean option
  • make sure you have enough permgen space allocated
  • clean your project inside of eclipse
  • examined the eclipse log files for oddness – wrong directories, missing access rights, etc…

If you are still hanging during the deploy operation then you are probably the culprit.  I have run across this a couple of times.  In these cases I retraced my recent changes to the site:

  • In one case I had re-organized a validator to be used differently, but the application context bean definition still referenced the old usage.
  • In another case my pre-loading of a static section really just would not work.

Hope this saves you some time.

Share