Welcome Login
Blog Photos Links

RSS Feed

Waiting for something to load?

December 1, 2011, 4:15 pm - James Farrer

Try as I may, there always ends up being some place where users on my websites have to sit and wait for something to load or happen. A while back a few co-workers and I came up with a bit of code to help with the situation. It's a little bit of javascript that has made a few people smile and hopefully will make plenty more smile.

Enjoy!

var randomLoadingMessage = function() {
    var lines = new Array(
        "Locating the required gigapixels to render...",
        "Spinning up the hamster...",
        "Shoveling coal into the server...",
        "Are we there yet?",
        "Hang on a sec, I know your data is here somewhere",
        "Searching for Answer to Life, the Universe, and Everything",
        "Warming up the processors...",
        "Re-calibrating the internet...",
        "Working... So, how are you?",
        "Please count to 100...",
        "Doing something useful...",
        "Are you ready?",
        "Prepare for awesomeness.",
        "Yes there really are magic elves with an abacus working frantically in here.",
        "Don't panic...",
        "Deterministically simulating the future.",
        "Searching through billions of bits to find what you're looking for.",
        "So, do you come here often?",
        "Recalculating PI...",
        "Preparing for hyperspace jump",
        "Loading: one Mississippi Loading: two Mississippi Loading: three Mississippi",
        "Waiting for magic to happen...",
        "Please wait while the punch tape loads...",
        "The hamster is running as fast as it can, hold on a second...",
        "Searching for answers...",
        "Looking for exact change...",
        "Giving it all of got...",
        "It's around here somewhere... ",
        "Loading screen... If you can see this I'm still working on your request.",
        "Waiting for something in the server.",
        "This page brought to you by the Letter Q...",
        "Firing up the hyperspace quantum overdrive...",
        "Let me think about this...",
        "Gotcha, boss! Going right at it!",
        "Going the distance...",
        "Searching for dragons...",
        "Reassembling atoms...",
        "Winding up the rubber band...",
        "We're working on making this page load faster",
        "I spy something green...",
        "Configuring the flux capacitor"
    );
    return lines[Math.round(Math.random()*(lines.length-1))];
}

Daylight Savings Time - Where's the savings?

November 17, 2011, 10:44 pm - James Farrer

As we are getting over the semi-annual schedule tweaking adjustment of Daylight Savings Time I have to stop and think, "If Daylight Savings Time is so great, where's the savings?" I don't in any way profess to be an expert on why Daylight Savings Time came to be or really anything else about it. I do know that with a little bit of logical reasoning I have some serious questions about its value.

As it has been explained to me, some of the chief benefits of Daylight Savings Time have to do with the use of daylight during normal daytime hours, and the amount of energy consumed. I've heard the argument applied to farmers, fossil fuels, electricity consumption, etc. But nothing that I've heard gives me any confidence that the benefit is worth the cost. That's the direct cost., of the fuel or electricity or whatever we're trying to save. I've never heard of anybody actually trying to look at some of the indirect costs associated with this arbitrary adjustments of billions of clocks around the world.

According to the California Energy Commission (http://www.energy.ca.gov/daylightsaving.html) there is a qualified possibility of a 1% energy savings by adjusting to Daylight Savings Time, but they also talk about how there are studies that have found the end difference to be almost negligable. It varies by location, but most generally the recent arguments for Daylight Savings Time use and adjustments are based around people needing lights and using TV's, computers, and other small appliances.

I don't know if the energy savings have actually amounted to anything substantial. Based on the conflicting reports and arguments I see significant room for questioning those savings. In any case, there are some costs that should not be overlooked when considering Daylight Savings Time. These are time and cost of accomodating for the shifting answer to the question "What time is it?"

How much time did you spend thinking about when Daylight Savings Time takes effect? How many clocks did you have to set? Did you sleep poorly due to the time change? Did you forget to change your clocks and miss something? Or did you show up too early and had to sit around and just wait? All of these amount to extra time that has to be spent to make sure we are on time. And we do this twice a year. Think about it, 20 minutes for the first question, 20 minutes for the second, an hour of spaced out time at work due to the messed up sleep schedule, and a few extra minutes for the occasional missed meeting. I would place a conservative guess for this at 3 hours a year, per person. Assuming half the world really just doesn't care about the time that much we've got 3.5 billion x 3 hours coming to a total of 10,500,000,000 lost man hours. 10.5 Billion!!! Even at minimum wage that's a lot of "time is money" kind of cost.

Now for another side of indirect cost. The cost to make everything work across all the time zones, all the states, all the countries, where some use Daylight Savings Time and some don't, and many happen at different times of the year.

I work in IT and I know first hand that this can be a very frustrating and time consuming activity to account for in computers. This is a relatively new side of the challenge. When it all got started we just needed to worry about what time the train was going to arrive. Now we have to know what time the train, plane, bus, car, letter, email, text message, alarm, financial transaction, change to your phone bill, and change to just about anything stored on a computer. A lot of organizations do a lot of activities and reporting based on time. If the computer (at any of about a hundred levels) calculates the time incorrectly there is a very real effect.

So to get all these computer systems to work properly a lot of organizations have to pay a lot of programmers to spend a lot of time and headache making sure that the dates match and that we really know how many hours its been since that starting date and time. I have personally spent a number of days of my life purely trying to accommodate for these arbitrary changes to the time. And every computer, every computer program, every website, all need to be written in such a way as to make it all just work. I assure you this is not a trivial task. This is a very real cost to businesses. In an good economy this can be painful, in a bad economy this cost could be the difference between staying in business and shutting the doors.

For all the potential savings that Daylight Savings Time is supposed to give us, I think the costs, direct or otherwise, far outweigh the benefit. I would propose that we eliminate Daylight Savings Time completely. If the energy costs are that big of a deal then let's change the clocks once and be done with it.

And hey, given the current economic challenges, doing away with Daylight Savings Time right now would mean extra jobs to help accommodate for this final change in the short term. In the long term both business and government would be able to use all that extra time and money to invest in other more productive endeavors.

Then we can all sleep that much better two nights out of every year.

TractorLandscaping.com

September 28, 2011, 9:28 pm - James Farrer

My father-in-law just started a new business doing property maintenance and landscaping. He bought a nice big tractor and is already rolling. As part of that he asked me to build him a website. I've played with a number of different setups and figured Wordpress would be a good option for this one. I set it up and things look to be running pretty good. We're still updating some of the content but for a few days work I think it turned out pretty good.

Check it out: http://www.tractorlandscaping.com

New Server, sort of...

September 13, 2011, 10:41 pm - James Farrer

My old server was running out of space and in desperate need of some work so over the last few weeks I've been working on installing a new server and getting things migrated over to it. I believe I've got just about everything set up and working as I want it now. While on the public side of things there's not much difference, on the back end it's fairly refreshing to have a good clean set-up. Over time things just tend to get cluttered up so this was a nice chance to de-clutter.

Now that that's done it's on to another project I've been thinking about for a while.

The Flavor is Here!

July 22, 2011, 11:21 pm - James Farrer

I finally got some color and life breathed into the new layout. I got some ideas from my wife and daughter which helped get things rolling. It's always a work in progress but I think it's a good improvement over anything I've done before. I think I still want to make some changes to the header section to make it a little less drab but I'll have to think on that for a bit.

As I was working through the process I discovered the ability to add multiple background images (comma separated in the CSS tags) that apparently is new in CSS3.

I was also introduced to the drop shadows as done in CSS and was surprised at how easy it was and how good it looked. I did run into a challenge with the shadow overlapping the other content blocks. It was fairly confusing. I believe most of it has to do with the way I am using floats to do the layout. Floating the sections is certainly not the only way to do it but it made it so when there is the third column in the smaller layout I can drop it back to the left under the other menu. The example that I got the base for the layouts from used a mix of floats and fixed positioning and I ended up moving more entirely to floats for the main sections.

I tried using z-index to force the order on the content boxes but at most I could affect one section, and never the right ones in the right order. I ended up just avoiding it for now by making the shadow fit into the margin width so it doesn't overlap the content. I had to adjust some of the margins to get things to fit in the right places. This was probably a good thing anyways to make it more consistent.

Here's an example of the narrow 2-column layout. Click to see the old look and feel and the new at various sizes.

Google AppInventor

July 17, 2011, 4:33 pm - James Farrer

Google has released a Beta Android App building tool. I've only played with it for a little while but as near as I can tell it is an amazingly simple visual way to develop. It's a hybrid web/client program that allows for dragging and dropping of components and some basic manipulation. I've been wondering if someone would come up with something like this for programming in general. This might be the springboard into a much larger pool of developers in the world. This makes me wonder what this will change when almost anyone can "code" up a program.

Here's the URL: http://appinventor.googlelabs.com/

I'll be playing with this and looking to see what kind of future enhancements they add into it.

New Layout

June 22, 2011, 9:40 pm - James Farrer

At work we've been talking about putting together a new homepage and layout for the main university website and separately the department website that I work on. For a while now I've been wanting to make some changes to the layout of this site to make it a little easier to use. There are some confusing links, formatting that doesn't differentiate the pieces of content well, and very poor mobile support.

The proposed design for the new BYU website uses CSS media queries that essentially check the width of the browser and apply a different stylesheet. I thought this was pretty cool so I started looking into it some more and at this point, it has to be the best mobile support method I have come across.

With many mobile sites, there is some sort of redirect to a mobile friendly site, often a subdomain of m.companysite.com. This is great except that only about half of the sites that do this actually preserve links that point at the site so if you click on the link in an email or somewhere else, you end up at a scaled down set of content that has nothing to do with what you came there for. The idea of having a separate mobile site never quite made sense to me because you are causing a significant amount of extra work to maintain two complete layouts and in some cases, completely different content.

One alternative is to set things up so they squish when resized. When I last played with the layout for this site that is essentially the path I chose. It scales alright on a desktop and most of the time the content is where it should be, though occasionally things are getting cut off or just look funny. On a mobile device it has to scale it down and then you are doing the pinch and zoom, pan and scroll game. Not too fun, especially when you're trying to create content. Another downside to this method is that the width of the site is fluid which means on wide screens, paragraphs can stretch a long ways and become difficult to read. Some sites use fixed width, which works for a news article, but not for a photo gallery. I have both...

The CSS media queries gives an interesting combination. By switching out the stylesheets you can accomodate for narrow widths without affecting the wide ones. If you're careful with your HTML and use more CSS to do the formatting you can completely rearrange a menu structure simply with the stylesheet. This means the content is exactly the same. No dual site maintainance, no more squishy sections (at least not if you don't want it).

I'm not sure that this was possible to do until recently. More recent browsers are supporting a lot of the CSS features more consistently now which makes this actually work. When I first started playing with mobile access, phones didn't have the ability to run most javascript, but now, they can do most things and even the desktop browsers are getting much more compatible and reliable in how they format things.

In short, I've got a functioning improvement to the stylesheets and layout of the site. I'm not very good at some of the finer designer details so I'm just applying the new stuff since it's functional and I'll fix the rest as we go. So if you see some gray, don't be scared ;-).

Old site layout:

Now go ahead and try to resize the site. Watch it work and give me some feedback.

Power Point and Printing Slides with Notes

May 13, 2011, 11:53 am - James Farrer

I am preparing for a presentation at a conference and was trying to print out my slides with the notes next to them in a relatively compact manner. Wow, it was not very intuitive. I tried printing the slides and it had an option for Slides with notes, but it was one slide per page; not very compact. That was it, no other options.

I did some poking around and some searching and came across an option to Create Handouts. Viola! This is what I want, though, I'm writing this post while I wait for it to load. It basically takes the presentation and sends it to Word so you can edit it there and then print it out. There must be something wrong with my presentation because loading the individual slides and especially trying to send it to Word is taking forever and failing at times. It finally worked after I split the presentation in half.

In the end, the Create Handouts option gave me what I wanted. Small slides with the notes next to it.

Directional Light Sensor

April 22, 2011, 11:03 pm - James Farrer

Ever since I got the light meter going I've been thinking about what I could do with it. I want to hook up some servos but I don't have any yet and have needed something to do with them. I had the idea to set up a set of sensors to detect direction of something and then point something at it. Something to the effect of automatic aiming.

So here's what I've done. I set up five photocells each facing out and take the input in. The actual values that come in from each photocell vary so I normalize it between the max and min values for each photocell and map that to a range of 1000. Once I have the normalized data I compare the new value to the last value for each sensor and determine the difference. I set a threshold for the difference to minimize the noise and effectively adjust the sensitivity. Then I compare the difference between each of the sensors and whichever sensor has changed the most indicates the direction.

Since I don't have a servo to actually point in the direction I have set up five LED's with the proper one lighting up based on the direction from the photocells. It's a bit rough but it generally works. The biggest problem with the direction is when shadows cross over it. I think setting up a sort of hood over each photocell should help to keep them more direction based.

Some possibilities for improvement at this point include:

  • Hooking it up a little better so it's not just a bunch of wires strung around
  • Adjusting the LED's so they are also in the same general orientation as the sensors
  • Replacing the LED's with a servo and a set of eyes or something like that to indicate it's following the movement
  • Set up the threshold so it auto-adjusts to the amount of light and the deltas, probably using a sliding window to calculate it so a sudden light change would get it's attention but then over time more subtle changes could be detected
  • Take into account the data from several of the sensors to determine a more precise direction. For example if there are two sensors that are measuring similar changes, point to a spot in between them
  • Add a cannon, catapult, or laser to bring the application to a "useful" point of application on my desk at work...

Or click here for a still image of it.

Arduino Light Meter

April 16, 2011, 9:44 pm - James Farrer

Today while playing with the Arduino my Mom got me for my birthday, I was able to set up a rudimentary light meter. I took the input from a photocell and converted that signal to a range that corresponds to 5 LED's.

I also set it up to learn what the ranges are from the photocell. So if you start it up it will show relative light levels. E.g. In a dark room it will show full light reading down to zero. But if you add light to the room it will adjust the upper bound and scale everything accordingly.

Also, this was my first upload to YouTube. Not exactly the highest quality, but it shows the lights working when I cover up the photocell.

Group Management for a task system

March 27, 2011, 4:11 pm - James Farrer

I was thinking about a need at work in our ITSM Suite (we use Service-now.com but the problem has existed in our last couple of tools as well) and after tinkering with it for a while I came up with what I think to be a clever solution.

The challenge that we've had in several of our tools over the last number of years has been the ability to find the group for a user when assigning a task to someone (in this case an incident, but it is more generally applicable). Because the list of assignees is based on the group, things have typically worked like this: an incident is created and before they can save it they have to find who it should be assigned to, sometimes they know the group and sometimes they know the person to assign it to. If they know the group, then it's not too bad, but when they only know the person they have had to search through the groups one by one. In the past I created a seperate search utility that was flexible enough to use but still required jumping to a separate window to search and then manually coming back.

We are currently moving to Service-now for our incident tool and it has the ability to look up a person independant of the group which was the first step. It still didn't populate the group though, so we still needed some improvement. We could just look up the group, but in many cases people are part of multiple groups. We decided it would likely be worth setting it up so you could set a Primary Group for the user, but if that hadn't been done yet there was still a possibly random selection of the group. This is still better than nothing, but not ideal.

I finally had the idea to include an order field on the group. I could look up the groups a person is a member of and select the first one as the groups are ordered. This gives us a way to set the Primary Groups for almost everyone without requiring a Primary Group to be set beforehand. Since most of the duplicate groups are actually sub-groups of a larger group (often based on skills) this can be used the majority of the time.

Depending on the ordering of the groups there may still be some mostly random group assignments, but this will be more the exception than the rule. For cases where the general group ordering does not make sense they still have the ability to set a Primary Group for the user.

It only takes a few lines of scripting to implement the logic, is relatively maintainable and remarkably flexible. I'd say that qualifies for a good win.

Mark Zuckerberg at BYU

March 27, 2011, 3:31 pm - James Farrer

So Senator Hatch invited Mark Zuckerberg to come and do a Q&A session at BYU. It was surprisingly well attended. Apparently Mark had never done something like that. There was probably 10,000+people that showed up. I had heard rumors and had somehow formulated some ideas of what he was probably like but I was pleasantly surprised to see him act much more like a normal person (take that as normal for people that I hang around, which is significantly geekier than most people). Several of my co-workers agreed with me that he seemed very much like someone who would be comfortable hanging out with us on a weekend, and us with him.

Senator Hatch played the part of host and if this was any sort of indication he should never be a talk show host. He seemed to try and make everyone happy (I heard lots of "typical politician" comments from people walking away afterwards).

There were several things that rang true about what Mark said, but one of the things that was interesting was that he and his friends thought, hey this would be nice to have. Then they built it. It turns out other people also wanted it and now he's a multi-billionaire or something like that.

I'm pretty sure I could do what he's done. Now, I just need to come up with an idea...any suggestions?

A Great Article: The unspoken truth about managing geeks

March 3, 2011, 7:27 pm - James Farrer

This is a very good article on working with and managing IT groups. The world would be a much better place for everyone, not just the IT folks, if more people read, understood, and applied the stuff in this article. It may not be perfect, but it rang truer than just about anything else I've read or heard.

http://www.computerworld.com/s/article/9137708/Opinion_The_unspoken_truth_about_managing_geeks?taxonomyId=14&pageNumber=1

A few highlights:

"Good IT pros are not anti-bureaucracy, as many observers think. They are anti-stupidity."

"Users need to be reminded a few things, including:

  • IT wants to help me.
  • I should keep an open mind.
  • IT is not my personal tech adviser, nor is my work computer my personal computer.
  • IT people have lives and other interests."

"With IT, you cannot separate the technical aspects from the business aspects. They are one and the same, each constrained by the other and both constrained by creativity. Creativity is the most valuable asset of an IT group, and failing to promote it can cost an organization literally millions of dollars."

And last but not least:

"What IT pros want in a manager is a technical sounding board and a source of general direction. Leadership and technical competence are qualities to look for in every member of the team. If you need someone to keep track of where projects are, file paperwork, produce reports and do customer relations, hire some assistants for a lot less money."

 

Shifting times and priorities

January 23, 2011, 4:11 pm - James Farrer

So over the last year or so I've realized that while I enjoy photography and I think I'm pretty good at it, I'm definitely not good at advertising and getting business. I've also realized that I'm ok with this. So in this newly enlightened state, I am shifting the purpose of this site. I've been thinking about it for a while since it's mostly been sitting here figuratively collecting dust (I suppose the server is collecting dust, but that's another issue entirely). I figure life is a journey and this site will likely reflect that.

So having said all of this, I have started adding various bits of information that present a little more of my professional self and we'll see where we go from here.


What's New

There are currently no new items, please check back later.

Archives
2017 (1)
  January (1)
2016 (4)
  December (1)
  November (1)
  May (1)
  January (1)
2015 (1)
  December (1)
2014 (2)
  August (1)
  February (1)
2013 (4)
  October (1)
  July (1)
  June (1)
  April (1)
2012 (11)
  December (2)
  October (3)
  September (1)
  May (1)
  April (1)
  February (2)
  January (1)
2011 (14)
  December (1)
  November (1)
  September (2)
  July (2)
  June (1)
  May (1)
  April (2)
  March (3)
  January (1)
2009 (2)
  October (1)
  June (1)
2008 (1)
  September (1)