What type is a var?

Java 10 introduced “var” where the type of the variable is implied. This leads to some tricky scenarios.

We first learn that “var” can replace the type. That means these two code blocks are equivalent.

int a = 9;
int b = a;
var a = 9;
int b = a;

Ok. So far so good. Now we have this code:

short a = 9;
short b = a;

So we substitute var and the code no longer compiles!

var a = 9;
short b = a;

What’s going on? Well, Java is only using the one line to figure out the type. Since int seems like a reasonable default, variable a is an int. Until of course, we get to the next line and it isn’t.

This would compile, but defeats the purpose of using var. So be careful!

var a = (short) 9;
short b = a;

Calling from an airplane

I wanted to listen to a phone call while I was in the air. I wasn’t sure if it would work, but worth a shot!

I tried Skype, but it dropped the call after just a few tries due to a poor network connection  While the JetBlue wifi isn’t weak (you can watch video on Amazon Prime), you arent supposed to be doing phone calls  so maybe they block it.

My second attempt worked.  I used wifi calling on my iPhone. It is off by default.  What I did:

  • turn on airplane mode (did before plane)
  • connect to jetblue wifi
  • go to flyfi.com in a browser and accept terms on service
  • go back to settings.  Go to the cellular section (you can leave cellular off to do this)
  • go to wifi calling and turn on
  • accept the two prompts

That’s it.  I was able to make a call from my phone.  After the call, I turned off wifi calling since im not familiar with the impact.  And it isnt as if I am running out of minutes!

Nite that you arent supposed to make phonecalls in the air lest it annoy your neighbors.  However, listening to a call is like listening to a podcast.  I’m on mute the whole time  and my headset doesnthsve a mic anyway.

 

 

first volunteer coordinator – usability – a click analysis

I am co-volunteer coordinator for the NYC FRC (FIRST Robotics Competition) regional. The volunteer system could have better usability.  I’ve been thinking about writing up a “click analysis” for common workflows. The idea being that good usability shouldn’t take a large number of clicks to do something common. When my friend asked how to cancel an application, I finally decided to it.  (cancelling is at most 4 clicks once logged in which isn’t bad. )

But on to the most common volunteer task once you are logged in as a volunteer coordinator. How many clicks and are they all necessary.

Accepting a volunteer – 9-12 clicks

  1. Click on the regional name [if you only manage one event, this click should be inferred and not something you have to do each time]
  2. Click on the role you want to assign
  3. If you don’t already know the person, right click their name for details (to open in a new tab)
    1. Click current applications
    2. Click assignment history
  4. Either drag the person’s name to the table at the bottom or click the checkbox and then
    “move applicant into schedule”. I find dragging slower, so this is two clicks for me.
  5. Drag tentative to the table once per day the person wants to volunteer. (Or drag once and expand the bar to cover all the days). So this is 1-3 click/drags
  6. Click complete assignment
  7. Click checkbox for name again
  8. Click assign and notify selected
  9. Type message
  10. Send

Seeing all unassigned volunteers = 3 + 2n

There’s a report called “all unassigned volunteers”. But it doesn’t have links from the person’s name to their profile. Which means you can’t assign from there and have to do it the long way.

  1. Click on the regional name
  2. Click a role. Ideally without any unassigned volunteers
  3. Click unassigned applicants
  4. Right click each to open new tab
  5. Click current applications