Chromebook the third!

I bought my mother a Chromebook in 2012 and again in 2014. That one lasted longer and here we are five years later. It’s time to replace the Chromebook with her third one. Definitely a happy customer.

I went the Best Buy like the last two times. The number of Chromebooks on the market exploded! I think they had nine in the store. I went with the Acer Chromebook 15. It’s a basic machine with built in speakers. Like actual speakers, not embedded ones.

Comparing the stats from 5 years ago

My mother wants to listen to music now. This means I care about the hard drive now when I didn’t five years ago. Everything is better on this machine except the CPU. The computer is never CPU bound though so that seems ok

Asus (2014)Acer (2019)
Screen size13.3″15.6″
Price$299$240
CPUIntel 2.16 GHzIntel 1.6 GHz
RAM2 GB4GB
Hard Drive???16GB
USB1 USB 2.0 and 1 USB 3.02 USB 3.0
HDMIYesYes
Weight3.1 lbs4.41 lbs
Headphone jackYesYes
Battery life???12 hours

Setting up the Chromebook

  • The Chromebook was set to Sept 18th 1:00 on May 15th 10:21. Maybe that’s when it was built/packaged? It got fixed automatically when I connected to wifi
  • I chose “let’s go” on the welcome screen and connected to my home wifi.
  • I then got the ChromeOS terms page. For about a minute, it showed me a cert invalid page. Then the screen loaded with the terms. Weird.
  • I chose not to send data to Google and accepted the terms. (My mother is bandwidth constrained so don’t want to use up any helping Google.)
  • Signed in. My profile was automatic. Since I signed on as my mother, I got her giant accessibility cursor
  • I accepted Google Play/Google Drive since I want to use an app. I did not enable location services.
  • On settings
    • disabled Bluetooth
    • disabled sync for passwords/addresses/google pay
    • changed time zone to Pacific
    • turned off check if have payment methods saved
    • on site settings, disable microphone and camera
  • Installed Keep Awake browser extension
  • Covered camera
  • Right click desktop and choose “set wallpaper”. Choose light blue under solid colors
  • I tested the USB, HDMI headphones and that a Kensington security lock works with
  • I made a recovery disk. The procedure hasn’t changed
  • Finally, I deleted a bunch of apps (go to the circle icon in the lower left corner). Right click the app to uninstall. The “uninstall” button is blue and looks grayed out, but you can still click on it (I needed a mouse for this – deleting with the trackpad doesn’t work.) I deleted a lot of stuff because it’s less apps my mother won’t use. Which means less stuff that needs to download auto updates
    • ebay
    • Play Movies
    • Play Music
    • Play Games
    • YouTube
    • Google Maps
    • Google Keep
    • Google Photos
    • Text
    • Calculator

How to register for the OCA 8 or OCP 8 study guide online materials

Wiley/Sybex recently redid their website. One of our readers (and I), didn’t find it that intuitive how to register the book to gain access to the practice materials. Their tech support was excellent and now I know what to do!

It’s actually the same as the old procedure. I just had trouble finding the links

Step 1 – Get an access code

  • Go to the registration URL
  • Choose the OCA 8 or OCP 8 book from the pull down
  • Fill out the form. Note that you’ll need the book handy to answer one question about it. Don’t worry. The question will be something like “what is the caption of Figure 1.2” and not something that requires understanding the material

Step 2 – Get the access code.

Wait until you get an access code in your email. The instructions say it takes up to 24 hours, but I got it within 5 minutes.

Step 3 – Add code on the new test bank website

If you bought our OCA/OCP Practice Exam book, you already have an account on this site. If so:

  • Log in
  • Click redeem access code
  • Copy/paste the access code from the email

If not, sign up for an account now.

  • Go to the test bank site
  • Click create account
  • Copy/paste the access code from the email
  • Filll out the other fields

DevNexus 2019 – Alternatives to Java Reflection and Unsafe Usage – Chandra Guntur

See the table of contents for my other blog posts from the conference

This presentation is a lot of live coding with this kata.

JSR 292

  • Multi Language VM proposed in 2016
  • Code named Da Vinci Machine project
  • Gained ability to change classes and methods at runtime

Issues with reflection

  • Performance overhead
  • Security restrictions
  • Exposes internals – breaks abstractions and encapsulation

Method handle

  • Goal is to make as fast as a statically linked Java call
  • Mainly same since Java 7
  • More verbose than reflection
  • Performance benefit because only checks accessibility the first time you use it
  • Main APIs:
    • MethodHandles.Lookup – searches for a method handle
    • MethodHandle – execution logic
    • MethodType – represents return type and input parameters of a method. Immutable

Katas

  • Call constructor using a method handle
    • MethodHandles.publicLookup() – gives a loop reference
    • MethodType.methodType(void.class) – constructors don’t have return types so void
    • lookup.findConstructor(DemoClass.class, methodType) – actually get the MethodHandle
    • handle.invokeExact() – invoke method (well, constructor) with no parameters. Need to cast result so correct type.
  • Pass in parameters
    • handle.invokeExact(“paramValue”) – note that the parameters are bound at runtime. If call with wrong params, get runtime exception
  • Call a public method
    • MethodType.methodType(String.class, String.class) – a method that takes a string and returns a string
    • lookup.findVirtual(DemoClass.class, “methodName”, methodType) – call public method with findVirtual
    • handle.invoke(demoClass, “param”)
  • Call a private method (protected and package private work the same way)
    • DemoClass.class.getDeclaredMethod(“name”, String.class)
    • privateMethod.setAccessible(true) – just like with reflection
    • lookup.unreflect(method) – creates lightweight version
    • handle.invoke(demoClass, “param”)

VarHandle

  • Unsafe still deprecated (but not removed) in Java 12
  • VarHandle replaces Unsafe in many cases
  • Standard replacement for some features for atomic concurrency and Unsafe
  • Can use to access field/array index elements
  • Memory fences for fine grained control of memory ordering
  • A strong readability fence
  • Improves safety – requires content types to match/be castable. Also requires array indexes to exist
  • Improves integrity – Follows field access rules including honoring final
  • Performance equivalent to Unsafe
  • API more usable than Unsafe because intended to be an API
  • Uses coordinates since fields are referenced by name.

My take

I like reflection so this was a good opportunity to learn about it’s “successor”. I enjoyed seeing the live coding. In addition to Method Handles code, it was nice to see the callouts to some IntelliJ features. Chandra did a kata on VarHandles. I didn’t take notes on that since I was reviewing my presentation which is next.