My thoughts as an enterprise Java developer.

Tuesday, December 10, 2013

More interesting wait screen

I have seen many wait screens that do the job but are boring. I think it might work a lot better to make a wait screen that displays something interesting. Maybe draw a fractal or present a simple game. If there is something interesting, the user shouldn't mind the wait as much.

Friday, December 06, 2013

U.S. Supreme Court to decide whether software can be patented | Reuters

U.S. Supreme Court to decide whether software can be patented | Reuters: "The U.S. Supreme Court on Friday agreed to decide on a key software industry issue of which kinds of computer-related software are eligible for patent protection."

Thursday, October 17, 2013

The type of work that I like to do

I like working on detailed, complex, and/or interesting problems on a product that I know well, has a large codebase, and has to support high load. I call those “guru-level” problems.

Tuesday, October 15, 2013

Change comments to logs?

It seems that almost all of the time, comments in a method work better as logging statements.
Reasons:

  • The log statements still give clues to the developer about what is happening
  • The log statements also give that information to someone looking at the logs
  • Since log statements will be seen more, they are more likely to to kept current

Thursday, October 10, 2013

Sitting Too Much Could Be Deadly, Experts Say | Fox News

Sitting Too Much Could Be Deadly, Experts Say | Fox News: "Scientists are increasingly warning that sitting for prolonged periods — even if you also exercise regularly — could be bad for your health. And it doesn't matter where the sitting takes place — at the office, at school, in the car or before a computer or TV — just the overall number of hours it occurs."

" "After four hours of sitting, the body starts to send harmful signals," Ekblom-Bak said. She explained that genes regulating the amount of glucose and fat in the body start to shut down."

One idea that comes to my mind is to setup a standing height desk. The computer would be setup with remote desktop so that employees using it could connect back to their workstation and do work as if they were at their desk.  That cube could then be reserved like a conference room so that employees could use it for a few short periods during the day.  Optionally, the cube could have a tread mill right in front of the computer so that employees could also walk while working.

Thursday, October 03, 2013

A Simple Rule to Eliminate Useless Meetings | LinkedIn

A Simple Rule to Eliminate Useless Meetings | LinkedIn: "materials that would typically have been presented during a meeting be sent out to participants at least 24 hours in advance so people can familiarize themselves with the content"

"begin each meeting by providing attendees roughly 5-10 minutes to read through the deck"

"Once folks have completed the reading, it's time to open it up for discussion.There is no presentation. It's important to stay vigilant on this point as most people who prepared the materials will reflexively begin presenting."

"If the material has been well thought out and simply and intuitively articulated, chances are the need for clarifying questions will be kept to a minimum."

XSLT example to iterator through a comma separated list

<?xml version="1.0" encoding="UTF-8"?>
<comma>1,2,3,4,5,6,7,88,99,100</comma>

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
    <xsl:template match="/">
        <xsl:call-template name="splitcommas">
            <xsl:with-param name="comma" select="comma"/>
        </xsl:call-template>
    </xsl:template>
 
    <xsl:template name="splitcommas">
        <xsl:param name="comma"/>
        <xsl:choose>
            <xsl:when test=" not(contains($comma, ','))">
                <value><xsl:value-of select="$comma"/></value>
            </xsl:when>
            <xsl:otherwise>
                <value><xsl:value-of select="substring-before($comma, ',')"/></value>
                <xsl:call-template name="splitcommas">
                    <xsl:with-param name="comma" select="substring-after($comma, ',')"/>
                </xsl:call-template>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
 
</xsl:stylesheet>

Wednesday, October 02, 2013

Keeping sensitive data out of logs

When a product has logging there is a risk that sensitive data(i.e. passwords) will make it into the logs. How do we reduce that risk?

Logging an object or adding toString to a class might not obviously leak sensitive data so it is probably better to make sensitive data obvious. i.e. If sensitive data is stored in a Properties object, as soon as the properties object is obtained, it should move sensitive data to a separate location (i.e. a separate String variable in the class) and remove the sensitive data from properties so it is obvious that there is sensitive data.

Google security exec: 'Passwords are dead' | Security & Privacy - CNET News

Google security exec: 'Passwords are dead' | Security & Privacy - CNET News: "looking ahead, "our relationship with passwords are done," and that "passwords are done at Google.""

"any startup that still relies on standard passwords needs to ensure that it has an abuse team set up to deal "with customers getting compromised." "

"anyone starting a new technology company should be sure that one person is designated to focus on security and privacy, and that one of the first 25 employees should work full time on security and privacy."

OSGi

OSGi Tutorial: "What is the OSGi Service Platform? A Java framework for developing (remotely) deployed service applications, that require: Reliability Large scale distribution Wide range of devices Collaborative" It supports multiple jar versions so each library can use the version that it wants.

Tuesday, October 01, 2013

Semantic Web: Resource-Oriented Architecture Patterns for Webs of Data

Resource-Oriented Architecture Patterns for Webs of Data:

Start on page “1” (about 60%).

"Whatever domain we work in, we can imagine translating the data elements we care about into named resources:
http://example.com/account/user/jsmith,
http://example.com/employee/id/12345,
http://example.com/order/id/101-276-32, or
http://example.com/product/id/upc/800314900528.
These names represent good, long-lived, stable identifiers for these disparate domains."

"Avoiding data extraction, transformation, and loading (ETL) steps reduces the burden of having multiple copies of our information repositories. We can achieve the goals of a Master Data Management solution while simultaneously avoiding the unnecessary limitations of a prescribed format."

"When you point your browser at any random website, it does not “know” anything. It issues a standard, semantically constrained verb, called GET, to a named element and responds to what comes back. “Oh, an HTML document! I know how to parse that.” or “Oh, a plain text file, I know how to display that.” It is reactive. It does not know. Knowledge is a form of coupling."

"The client does not know what it is going to get, it reacts to what is returned. It knows how to parse standard types. And from there, it discovers what options to present to the user (if there is one)."

"The media type should be designed to support hypermedia links. This should identify the resource itself, as well as its related resources. Clients will be able to “follow their noses” through your hypermedia representations. In the following example, we can find our way back to the account resource itself (useful if we did not fetch it initially but were given the representation as part of an orchestration), its recent orders, as well as individual orders.
1 < a c c o u n t i d = " 12345 " >
2 < l i n k r e l = " s e l f " h r e f = " h t t p : / / e x am pl e . com / a c c o u n t / i d / 1 2 3 4 5 " / >
3 b s l e t t e n < / name >
4 < s t a t u s > g o l d < / s t a t u s >
5 < r e c e n t O r d e r s h r e f = " h t t p : / / e x am pl e . com / o r d e r / a c c o u n t / i d / 1 2 3 4 5 / r e c e n t " >
6 < o r d e r i d = " 141234541234 " h r e f = " h t t p : / / e x am pl e . com / o r d e r / i d / 1 4 1 2 3 4 5 4 1 2 3 4 " >
7 < i t e m s > . . . < / i t e m s >
8 < / o r d e r >
9 < o r d e r i d = " 452354234534 " h r e f = " h t t p : / / e x am pl e . com / o r d e r / i d / 4 5 2 3 5 4 2 3 4 5 3 4 " >
10 < i t e m s > . . . < / i t e m s >"

"A slightly more verbose representation [of a collection]:
1 < a c c o u n t s h r e f = " h t t p : / / e x am pl e . com / a c c o u n t / s t a t u s / to p " >
2 < a c c o u n t i d = " 12345 " u s e r n am e = " j o j a l e h t o " s t a t u s = " a c t i v e "
3 h r e f = " h t t p : / / e x am pl e . com / a c c o u n t / i d / 1 2 3 4 5 " / >
4 < a c c o u n t i d = " 34246 " u s e r n am e = " bkemp " s t a t u s = " a c t i v e "
5 h r e f = " h t t p : / / e x am pl e . com / a c c o u n t / i d / 3 4 2 4 6 " / >
6 < a c c o u n t i d = " 77323 " u s e r n am e = " bl u u " s t a t u s = " d i s a b l e d "
7 h r e f = " h t t p : / / e x am pl e . com / a c c o u n t / i d / 7 7 3 2 3 " / >
8 < / a c c o u n t s >"

"The clients will not have to know how to paginate across arbitrary collections, they will simply discover links related to the collection with a rel type of next or previous. The server still drives URL layout, which is what we want in a hypermedia system."

This may not be as useful for external systems but seems more useful for internal systems where you can make your clients use the extra info.

The full book is available for $20.

Wednesday, September 25, 2013

Database Changes Done Right - The Daily WTF

Database Changes Done Right - The Daily WTF: "Unlike application code, you can’t exactly drop a bunch of files in a folder and proclaim that a new version has been successfully deployed. You also can’t just put back an older set of files to rollback your changes.

The only way to change a database is by running a SQL script against that database, and once you’ve done that, there’s no going back. You can run another SQL script to change the database again, but the only way to truly rollback changes is by restoring the entire database from back-up."

"Database versioning is as simple as maintaining a metadata table with two columns: Unique ID and Execution Date. Before executing a change script, simply check the table to see if the script has been executed already and, if not, run it and stored the script’s unique ID and date."

Friday, September 20, 2013

Integrating ALM: Lessons Learned Deploying Tasktop at Nokia | Dr Dobb's

Integrating ALM: Lessons Learned Deploying Tasktop at Nokia | Dr Dobb's: "This is one of those situations where an incremental approach with early user engagement -- where you have a chance to adapt installation or orientation materials -- pays off. If you pay close attention to the sorts of things that cause people grief during development, you can deal with them by creating either a development story (which changes the UI in some way) or a training story (for which you develop or enhance your training materials)."

"The moral here is to consider carefully every case of new user confusion, as it may be a warning of things to come."

"Software that supports complex tasks will probably require an investment in time for users to become adept. A well thought out UI and training material will allow users to perform basic tasks quickly and gain immediate benefit from their first steps onto the learning curve."

"Make any training screencasts short -- even if they're well structured, their perceived size can be off-putting (the user sees a 40-minute price tag on the screen and decides to set aside their learning for another day that never comes)."

Comments for people considering software engineering

I enjoy all the new problems & industry changes, that we can make a huge difference, and that it is usually quick to see the results of my work.
I didn’t expect my college degree to teach me so little of what I use each day – they are only able to teach the basics and we have to continuously learn new stuff.
I suggest going the extra mile if you only do the minimal coursework you won’t excel.  Do more and better than is required and/or side projects to push the boundaries of what you know and practice learning on your own.  Get involved in projects, research ideas, and try out new skills.

Increasing the max heap size can increase the chance of an OutOfMemoryError in Java

4.5 years ago I encountered a problem where I fixed an OutOfMemoryError by decreasing the max heap size.

Basically there is a C++ heap and if the Java heap takes up too much space then the C++ heap can get an OutOfMemoryError.  This generally happens when the java heap size is too near the maximum that that O/S allows – for Windows XP that max is in the 1.2 to 1.4 GB range so if your max heap size is 1 to 1.2 GB you may experience this problem.

Thursday, September 12, 2013

The cost of patches

Developers are willing to put almost any issue into a patch, but we want to make sure that the customer knows what a patch costs them. A patch is an extra build that causes development hours of extra time to create, Q.A. hours of extra time to test, and extra time to install. We must always balance having some issues into production faster with having more issues get done in the long run.

Monday, August 26, 2013

What to do after "trying it again" works

News August 2013: "But if "try again" works, that doesn't mean you've solved the issue, it means you've just worked around it. Most operations are happy to leave it there, and most users are equally happy, after all it's working now and that's mainly what matters. But there's a glitch somewhere, and glitches tend to come back when you least want them, especially under load when it can make things even worse on your system"

Wednesday, August 07, 2013

Victory Lap for Ask Patents - Joel on Software

Victory Lap for Ask Patents - Joel on Software: "It took me about fifteen minutes to stop a crappy Microsoft patent from being approved."


Tuesday, July 23, 2013

Registry Hacks

These are some of my favorite Windows registry additions:

Add Notepad as a right click menu option to open any file:
CLASSES_ROOT\*\shell\notepad\command\:REG_EXPAND_SZ: %SystemRoot%\system32\notepad.exe %1

Add DosHere as a right click menu option to all folders to start a command prompt in that directory:
CLASSES_ROOT\Directory\shell\DosHere\command\:REG_EXPAND_SZ: %SystemRoot%\system32\cmd.exe /k cd "%1" && title %1

Wednesday, July 17, 2013

PayPal makes man $92 quadrillion richer (temporarily) | Technically Incorrect - CNET News

PayPal makes man $92 quadrillion richer (temporarily) | Technically Incorrect - CNET News: "Please imagine, for example, how giddy Pennsylvania PR executive Chris Reynolds must have felt when PayPal made him $92 quadrillion richer -- $92,233,720,368,547,800 richer to be precise."

That is $41.92 more than the max amount of money (in pennies) that can fit in a signed 64-bit number.

Tuesday, June 11, 2013

Deprecation Plan


Once a method is deprecated, Java seems to have no further plans for removing it before Java 2.0 (if that ever happens).

I suggest the following steps be done by default:

  1. Deprecate the method (Java already does this) and generate info log about using the method
  2. At the next major release, increase the logging level to warning
  3. At the next major release, increase the logging level to severe and remove from compile time libraries
  4. After 2 major releases, throw an exception in the runtime (with useful message)
  5. At the next major release, remove from the runtime

For example, the old Java 1.0 AWT event model was deprecated in 1.1. It this plan was followed, it could not have been used in code compiled in 1.3 (3 years after deprecation) and would have thrown an exception with the 1.5 runtime (7.5 years after deprecation).

Of course the timing of those steps may have to be tweaked (i.e. quick releases, widely used methods, etc) but it can be the default blueprint for getting rid of old code.

Do you prefer the current plan of leaving deprecated methods until Java 2.0 or do you think we should have the above plan or another plan for removing them.

Thursday, May 02, 2013

Why We (Still) Believe in Working Remotely � Blog – Stack Exchange

Why We (Still) Believe in Working Remotely � Blog – Stack Exchange: "If you’re hiring for technical positions, hiring remotely is the best-kept, blindingly obvious secret for finding people."

"when going to work is as simple as walking upstairs (pants optional, but recommended) people just tend to put in more hours and work more productively."

"Our remote developers are some of the most argumentative people in the whole company, because we hired them to be that way. We like opinionated people. Opinionated people find things they care about to work on and make sure you know what they think, which is essential if you’re not sharing an office together."

"If even one person on the team is remote, every single person has to start communicating online."

Tuesday, April 30, 2013

Java Performance Tuning News April 2013: Engineering

News April 2013: "If engineers could build a bridge, and for not very much cost could test it to destruction by driving something heavy over it but with no casualties and leaving no debris; and, finding that it didn't handle the heavy vehicle, could just work on buttressing some aspect of the bridge, and for not very much cost a couple of days later put the next version of the bridge up for testing, it wouldn't surprise me to see bridges developed in just that way. And finally I realised that software engineering differs from most other types of engineering in a very specific way. We have a cost model that mostly encourages us to build incomplete constructs, because it's relatively cheap to fix. Where this doesn't apply (nuclear power plant management, aircraft fly-by-wire systems, etc), development times are much longer and much more expensive (for the equivalent amount of software).

Is this good or bad? I make no judgement. But I will observe that in the last 20 years the way people live in large chunks of the world has dramatically changed from all the half built continually buttressed software engineering projects that make up the web, the world of apps, and all that we can find in cyberspace, on our laptops, desktops and phones."

Thursday, April 25, 2013

Interfaces: balancing debugging vs. customization

What are the cost vs. benefits of creating interfaces and how to balance them. I am only considering cases where interfaces are optional and aren’t needed.
    Benefits:
  1. Simplify interaction: Easier to see how to use a List than an ArrayList
  2. Make testing easier because replacement implementations can be used
  3. Can make future changes easier
    Costs:
  1. Harder to understand what the code is doing
  2. When you need to look at the implementing class, it can take a lot of work to find it.
According to SOLID, "one should “Depend upon Abstractions. Do not depend upon concretions.” "
The citation says: “, as much as is feasible, the principle should be followed. The reason is simple, concrete things change alot, abstract things change much less frequently. Morevoer, abstractions are “hinge points”, they represent the places where the design can bend or be extended, without themselves being modified (OCP).”

I don’t see that all or even most concrete things change a lot (at least in their public interface). If the public interface needs to change then doesn’t that mean that the interface class probably would need to change also?

How would that work with a Swing program? Would all GUI elements need to be passed in as interfaces?



Can documentation be a "bad smell"?


How much code documentation is a symptom of bad coding (i.e. poor method or variables names, poor class or package structure, missing logging, etc)?

Saturday, April 06, 2013

Management: Enemy of Enterprise - Doug French - Mises Daily

Management: Enemy of Enterprise - Doug French - Mises Daily: "Once you have the business going, interruptions must be avoided; they are productivity killers, as are meetings. Get some sleep, get some quick wins and remember that good enough is fine and nobody can estimate worth a darn."

Wednesday, April 03, 2013

Crowd-Sourced Call Identification and Suppression | FTC Robocall Challenge

Crowd-Sourced Call Identification and Suppression | FTC Robocall Challenge: "We recommend the creation of a system that allows users to report, to an online database system, the originating telephone number of unwanted solicitations, advertisements or robotically placed calls (henceforth called “spammers”). We also recommend that users’ telephones or external hardware may automatically query the database about the telephone number of an incoming call (before the call is answered, or even before the telephone rings) to determine if the caller has been flagged as a spammer by other users, and optionally block the call or otherwise handle it differently from a non-spam call."

Wednesday, March 27, 2013

Titles are Toxic: Rands In Repose

Titles are Toxic: Rands In Repose: "never in my life have I ever stared at a fancy title and immediately understood the person’s value"

"The main problem with systems of titles is that people are erratic, chaotic messes who learn at different paces and in different ways. They can be good at or terrible at completely different things, even while doing more or less the same job. A title has no business attempting to capture the seemingly infinite ways by which individuals evolve. They are imprecise frameworks used to measure the masses. To allow leadership to bucket individuals into convenient chunks so they can award compensation and measure seniority while also serving as labels that are somehow expected to give us an idea about expected ability. This is an impossibly tall order and at the root of title toxicity."

"Titles, I believe, are an artifact of the same age that gave us business cards and resumes. They came from a time when information was scarce. When there was no other way to discover who you were other than what you shared via a resume. Where the title of Senior Software Engineer was intended to define your entire career to date."

Wednesday, March 20, 2013

Estimation


PurposeOfEstimation: "For me, estimation is valuable when it helps you make a significant decision." i.e. "allocation of resources" or "to help with coordination"

"So whenever you're thinking of asking for an estimate, you should always clarify what decision that estimate is informing. If you can't find one, or the decision isn't very significant, then that's a signal that an estimate is wasteful. When you do find a decision then knowing it focuses the estimate because the decision provides context. It should also clarify the desired precision and accuracy."

"I once remember a gnarly project manager say that plans and estmates were like a lettuce, good for a couple of days, rather wilty after a week, and unrecognizable after a couple of months."

Friday, March 08, 2013

An Appropriate Use of Metrics

An Appropriate Use of Metrics: "Project management reinforces this perception by asking the question, "How many stories did we finish coding this week?" instead of the better question, "How many stories are we happy to release to end users?" or better yet, "How many stories did we release to end users?" An even better question is, "How much value have our users found from our recent releases?" "

"Use the following guidelines to lead you to a more appropriate use of metrics:

Explicitly link metrics to goals

Favor tracking trends over absolute numbers

Use shorter tracking periods

Change metrics when they stop driving change"

"The lines between the measure chosen to monitor progress towards the goal and the actual goal itself blur. Over time, the reason behind the measure is lost and people focus on meeting the target even if that metric is no longer relevant. A more appropriate use of metrics is to ensure that the chosen measure for progress, the metric, is teased out, yet related to its purpose, the goal."

"It is easy to monitor activity (how much time they sit at their computer) yet it is hard to observe the value they produce (useful software that meets a real need). "

"There may be significant difference between code coverage of 5% and 95%, but is there really a significant difference between 94% and 95%? Choosing 95% as a target helps people understand when to stop, but if it requires an order of magnitude of effort getting that last 1%, is it really worth it? "

"Looking at trends provides more interesting information than whether or not a target is met. Working out if a goal is met is easy. The difficult work, and one that management must work with people with the skills to complete is looking at trends to see if they are moving in the desired direction and a fast enough rate. Trends provide leading indicators into the performance that emerges from organizational complexity. It is clearly pointless focusing on the gap in a number when a trend moves further and further away from a desired state."