using switch expressions with sax

It’s been a lot of years since I used SAX so I wrote my handler method the way I remember it looking:

if (qualifiedName.equals("edition") || qualifiedName.equals("author")) {
   inTagWithText = true;
}
if (qualifiedName.equals("book")) {
   System.out.println(attributes.getValue("title"));
} else if (qualifiedName.equals("paperback")) {
   paperback = true;
} else if (qualifiedName.equals("authors")) {
   System.out.println("Paperback? " + paperback);
}

IntelliJ suggested that this would be better with a switch. It was right. The new code is:

switch (qualifiedName) {
   case "edition", "author" -> inTagWithText = true;
   case "paperback" -> paperback = true;
   case "authors" -> System.out.println("Paperback? " + paperback);
   case "book" -> System.out.println(attributes.getValue("title"));
   }
}

Thank you IntelliJ. That looks much better.

OMNY and the mysterious AutoLoad

NYC is in the (slow) process of switching from Metrocards to OMNY cards. I switched a good while ago (maybe a year ago?) I had my OMNY card set to automatically add $40 every time the balance drops below $10. This worked great for a long time. Until it suddenly didn’t.

How I found out

On July 25th, I tapped my OMNY card to get into the subway like I usually do. I then tried to change using a “free out of system transfer.” (Technically they charge you and reverse the charge on your balance, but it looks like a free transfer. I didn’t know this at the time although it explains the behavior).

My OMNY card was denied when tapping for the transfer. I tried at two entrances and several turnstiles. I went to the attendant booth but nobody was nearby. I then walked 8 blocks to another station. That station doesn’t have a free transfer, but I figured I’d pay another fare and complain for a refund later or see a person. The OMNY card was also declined there, but there was a station attendant. Who said “this happens sometimes” and call OMNY on the number on the back of the card. I said I would, but also I needed to get to work. She opened the door for me.

The problem?

The “problem” was that my balance on the OMNY card was negative 10 cents. So the “free” transfer didn’t work since I didn’t have the balance of a fare for them to borrow against and refund. From my point of ivew, the cards was denied in the middle of a trip.

The “problem” and difficulty of adding money as a workaround

It tried calling OMNY. They tell you how many people are ahead of you (I was 39th). I didn’t have a ton of time as I was only working half a day and needed to use the card again soon. After waiting 11 minutes, I was down to 23rd in line.

At the same time, i was trying to log into the website on a computer and my phone. It was super flakey. (Maybe this is why so many people were waiting on the phone.)

I got far enough to see I had a negative balance pretty quickly. The payment system failed a lot though. I couldn’t use the card I had registered because I didn’t have it on me so couldn’t type in the credit card verification number. So I tried adding the card I had on me. This took a bunch of tries because the system kept giving errors.

I finally got it in the system and tried to pay. A bunch of times I got error message. Then I got “payment denied; contact card provider.” I gave up on my position of 23rd on line to call the credit card company. Who said my card was not locked. I tried again and got “payment denied.” I then checked my email and saw that both “denied” payments went through. Ok. That is more money than I wanted to add. But at least my balance wasn’t negative. And I use transit a lot so it’ll get used up.

Someone on Reddit said the problem was caused by the Crowdstrike issues. Someone else on Reddit said the problem was that OMNY disabled autoload on commuter card accounts without saying anything.

Starting over?

Given the theory that this was a forever problem, I switched OMNY to add money on the 1st of each month. I don’t like that solution as I don’t pay the same amount each month so I’m going to wind up with too much. But temporary solution.

Then one of my friends said that autopay by amount with commuter card is working again. so I switched back. Someone in the Reddit thread said the same; that it’s working again.

How to switch autopay

It’s not obvious how to configure autopay. I managed to figure it out when I first setup autopay. But it’s been long enough that I didn’t remember. Writing it here so that if this happens again, I don’t have to figure it out for a third time.

While you can see that autopay is enabled using the UI, you can only configure it using the chatbot. Also you can’t change the type of autoload. It let me try but then kept it at the original balance based one. Also it was finicky about what words it let me use. You have to cancel and restart. The gist of what worked was:

  • OMNY greats me with my balance
  • I wrote “Remove Autoload from this card”
  • OMNY confirms
  • I wrote “configure autoload”
  • I then provided the info to configure the way I wanted it.

PASSED! Jeanne’s Experience Taking the Java 21 Certification Exam 1Z0-830

Oracle Certified Professional Java SE 21 Developer

As we mentioned recently, Oracle announced their new Java 21 Certification Exam 1Z0-830 this week. Scott passed first and wrote about his experience. Now I join the first few Oracle Certified Professional Java SE 21 Developer’s in the world.

Unlike Scott, who passed on the first attempt, it took me two tries. See my blog post from last week for why. Anyway, this time I passed with a 74%. I still had time pressure with only 10 minutes to review answers. (To be fair, it’s 9 days later; not enough time for Oracle to do anything with our feedback about length)

As we mentioned earlier last week, Oracle announced their new Java 21 Certification Exam 1Z0-830 this week. Scott passed on Friday and wrote about his experience. Today was my turn.

Changing my exam date

You have to wait five days to retake an exam. That would have been Saturday. however the exam is not offered on the weekend. So I registered for Monday. I then learned I needed to go into the office on Monday so got to learn how to reschedule the exam. It was very easy.l The exam registration email from Oracle has a link to reschedule. After that the form looks the same as booking originally where you choose a day and then a time. The Tuesday 7am slot wasn’t available by the time I knew Monday was no good so I switched to Wednesday at 7am.

Checking in

The blog post from last week . The proctor did not want to see my paper was blank. (While you don’t see the proctor’s name, zoom said it was proctor 8. Which is the same number as last time. So it might have been the same person.

The exam

Like last time, I had some very long questions. While a lot had a good amount of code to read, there were five where I had to scroll a ton. Those questions take a lot of time. I used the same techniques as last time with two extras:

  • I used my cursor as a pointer as I was reading code. This got me to be more careful reading so I didn’t miss things.
  • Thought in my head as if I was explaining to someone why I was ruling out choices. Again to force myself to be more careful.

Some of the questions on the exam were the same ones I got last week. Many were different. While I was somewhat faster on ones I’d seen before, I deliberately slowed myself down. My problem last week was silly mistakes not lack of knowledge. So I had to make a point of being more careful.

In terms of time, I had 16 minutes left with one skipped question. (There was one with a lot of reading near the end and I figured I’d feel less rushed if I did it last. I spent 6 minutes on that questions. I then spent 5 minutes checking a few. I still didn’t get to check the majority of questions I marked for careful review. Submitted with 5 minutes left.

We let Oracle know about the exam length problem so hopefully they do something to improve the situation.

For content, I got a lot of pattern matching and records. I didn’t get virtual threads or sequenced collections this time (I did last week) so definitely luck of the draw.

After the exam

I removed the Lockdown browser software from my machine. It has a lot of power so I like it not being there.

I also went to the CertView page to get my badge. I used Chrome as Safari on Mac didn’t let me expand the menus.

To see my exam details:

  • Expand “Exam Results” on left navigation
  • Click “Exam History” on left navigation
  • Click “Results” on this exam on the right side
  • This downloads a PDF showing which objectives you got a question wrong on

For credentials, expand “Credential Management” on left navigation. You can then download a certificate or badge. There are also links to post on Linked In or email a link to verify your credential. I then went on Linked in and added a credential including the credential URL.