[2018 oracle code one] Java 9, 10 and 11: Pitfalls for the Unwary

Java 9, 10 and 11: Pitfalls for the Unwary
Speaker: Simon Ritter
@speakjava

For more blog posts, see The Oracle Code One table of contents


General

  • If you aren’t already on Java 9 or 10, don’t upgrade to them. Go straight to Java 11. Java 9 and 10 are feature releases, not LTS releases

Compatibility

  • Compatibility has always been very important
  • A few exceptions, but not significant. Was a pattern match search and replace
  • 1.4 – couldn’t use name assert anymore
  • 1.5 – couldn’t use name enum anymore
  • Concept of deprecation added in 1.1 – statement that a newer version is better
  • Java 8 has 492 deprecated API elements and non had ever been removed
  • Going forward, get at least one release or warning. Noted that less than that would be no warning at all.
  • Starting Java 9, things getting removed.
  • “if your code only uses standard Java APIs, it will most likely work” – Mark Reinhold

Java 9 – Module system

  • 75 OpenJDK modules
  • 27 Java SE, 48 JDK (ex: tools)
  • Oracle JDK adds 14 more JDK, 8 Java FX and 2 Oracle specific. Applies to Java 9. Remember Oracle JDK 11 == Open JDK 11
  • Most internal APIs are now encapsulated
  • sun.misc.Unsafe – the clue is in the name. Everyone has used through open source library like spring
  • Can choose not to use modules. Leave everything on classpath. Everything is in the unnamed module which depends on all modules. All packages are exported.
  • Then can migrate to modules gradually. Try automatic modules where don’t have module-info.class file but still treat as module.
  • Try moving existing jar files from classpath to modulepath.
  • “Big Kill Switch” –illegal-access
    • permit – warn for first use of encapsulated API
    • warn – warn for every use of encapsulated API
    • debug – warn and provide stack trace for every use
    • deny – don’t allow use at all
    • At some point, the default will become deny. We don’t know when. Suspect it’ll be a good while.
  • Allow direct access to encapsulated APIS — add exports
    • List package names exposing. Can be to ALL-UNNAMED or to specific packages
    • Alternatively can do this in the jar file manifest. That way library can expose without users having to specify
  • ‘Allow reflective access to encapsulated API –add-opens
    • List package names you want to expose
  • jdeps
    • find dependencies so can see which modules using
    • includes jdk.unsupported which is where sun.unsafe lives
  • java.se – aggregator module – If just use java.se, everything should just work
  • java.se.ee – module not included by default in JDK 9/10
    • ex: corba, transactions, Java activation (beans activation framework), xml bind (JAXB), web services (SOAP based)
    • Audience survey showed a lot of people using SOAP based web services
    • Still affected if use Apache SOAP library because sits on top of java library
    • Options
      • –add-modules – to explicitly add
      • Use standalone package from Maven central – deploy to upgrade module path or standalone version on classpath

Other changes

  • Single underscore is now a keyword. Can no longer use as an identifier. Can use two or more underscores if really want underscore variable name. Will be introducing _ as lambda dummy parameter.
  • Deleted some deprecated methods
  • New tool in Java 9: jdeprscan – static analysis against class files and jar files to report Java SE deprecated APIs
  • JDK/JRE file structure changed. Flatter directory structure. Now have bin/conf/lib/jmods.
  • lib/ext and lib/endorsed removed. If create directory, get fatal error starting JDK. Fails fast!
  • JNLP (Java Network Launch Protocol) – now uses strict parsing
  • Removed lots of JVM flags and others were replaced with different flags.

Version numbers

  • Version string format has changed. Was 1.8.0_131.
  • Fun fact. JDK 7u55 has more patches than JDK 7u60
  • New format $FEATURE.$INTERIM.$UPDATE.$PATCH
    • Feature – main version number
    • Interim – always 0 – reserved for future use
    • Update – 0, 1, 2
    • Patch – for emergency updates

JDK 10

  • var is now a reserved type. Not a reserved word. Can still use as variable name. Can’t create class called “var”.
  • Removed for deprecated code.
  • javah tool removed (for JNI). How do javac -h
  • policytool also removed

JDK 11

  • Oracle JDK – commercial license
  • Oracle Open JDK JDK – Mark Reinhold wants OpenJDK to be an adjective; not a noun. [because people are going to say that?}
  • Browser plugin going away
  • Java Web Start going away. Some alternatives, but no drop in replacement.
  • jmc (monitoring/mission control) – now a standalone package
  • More deprecated code removed

My take: Great humor. And great review for the stuff I knew. Also good clarifications and learning for the parts I did not know. There were a lot of references to Java 9 and 10. For most things, these apply to 11 as well. In a few case, it was confusing what applied to 11 vs what was interim.

[2018 oracle code one] augmented reality for the masses

Augmented Reality for the Masses
Speaker: Siamak Ashrafi
@biocodes

For more blog posts, see The Oracle Code One table of contents


Imagination

  • Imagination is the beginning of science
  • Imagination will spark AR (augmented reality) on mobile
  • Imagination is not limited. Can grow it.
  • Necessity is not the mother of invention. It is plausible intellectual curiosity
  • Science fiction has to be rooted in plausible science. Many famous sci fi authors have science educational background
  • Arthur C Clarke’s rules:
    • When a distinguished elderly scientist states something possible, usually right. When says impossible, probably wrong
    • Way of discovering limits of possible is to venture a little past them into impossible
    • “Any sufficiently advanced technology is indistinguishable from magic”
  • Magic/imagination/design/science have a positive feedback loop
  • “Truth is stranger than fiction, but it is because Fiction is obliged to stick to possibilities. Truth isn’t” – Mark Twain.

Initial AR to present

  • 1901 – First mention of concept in Wizard of Oz. Marker on forehead about moral character. Read using electronic spectacles.
  • 1957 – First patent in space of AR
  • 1992 – Term coined by Tom Caudell at Boeing
  • 2007 – Smartphones exploded giving sensors and power needed to bring to the masses
  • Humans think linearly. So we overhype at beginning and then it exponentially grows and disruption happens. Currently in development phase.
  • Last year, Lowe’s started where can view your kitchen with the new products in AR.
  • This year presented at medical conference.
  • Apple and Google will bring to masses
  • Other early examples – virtually try on clothes, tell you about interest facts nearby, lanes least crowded in front of you (but caused traffic jam from everyone moving there)
  • Arise game – can only cross bridge when it is solid. Which depends on perspective. [I don’t get how this is AR. It seems like a game independent of the real world]

AR vs VR

  • AR – still living in real world. Digital information. Mixed mode
  • VR – for living in a new world – isolates from everything around. Covers eyes/ears.
  • AR on phone isn’t user friendly because awkward to hold phone in front of us.

Referencing locations

  • Fiducial markers – object uses for reference. Mattel used to play virtual Rock Em Sock Em robots. Just printed out a “map” and two people could play on phones
  • GPS markers – actual location
  • Legacy mixare.org – used camera/compass/etc to do markers around you

Technologies

  • Tango 3D Mapping – 7 degrees of freedom.
  • Google killed Tango phone in less than a month.
  • Superseeded by AR Core
  • IMU – Inertial Measurement Unit – reports force/rate and sometimes magnetic field. Humans do this automatically. Uses dead reckoning.
  • With one camera can capture two (or more) frames. Build point cloud to see what pixels same and where moved. Doesn’t work with low light/shadows/on tripod.

AR Core

  • Motion tracking – pose (position and orientation of phone). Also COM (concurrent odometer and mapping) to keep virtual objects in right position. Hard math
  • Environment understanding – detect horizontal services so can put objects on them
  • Light estimation – make virtual objects right brightness for ambient light

AR KIt

  • iOS library. Supports iPhone 6s+ and old iPads (and current ones)
  • Same terminologies and principles as AR Core.
  • Library existed before AR Core.
  • AR Kit 2 came out recently – adds sharing experience. Can save/reuse environment.

Code/Getting started

  • Repo: https://github.com/google-ar/arcore-android-sdk
  • coursera.com/learnar
  • 90 line program
  • Have XML AR fragment
  • Then build model
  • Many models available online

Demo

  • He said the demo always crashes his machine. Running on beta version of OS/emulator/plugin [good to do with 4 minutes left then!]
  • Three calls in Android app – load fragment, create model and add listener. It’s about a page of code as two of the calls have nested lines of code.
  • Solar system with multiple models what build on each other.
  • Built point cloud. Use virtual sensors using IDE controls.

My take: He did a plug for voting thumbs up before actually starting. I don’t think I’ve seen that approach before. I was more interested in the higher level, but it was cool to see the details of the Android library as well. The speaker said he was surprised to have an Android talk accepted. I’m not. It’s in the ecosystem. Overall, it was cool seeing what’s out there.

[2018 oracle code one] skill developers need to design career

The One Skill Developers Need to Design their Careers and Break the Career Plateau

Speaker: Bruno “Javaman” Souza & Rodrigo Moutinho

@brjavaman and @rcmoutinho

For more blog posts, see The Oracle Code One table of contents


For junior developers (less than three years)

  • Most important is to do things
  • If you don’t “do”, you don’t learn
  • Can’t just read about programming
  • Hard skills are precise. Do same way every time. Ex: typing, IDE shortcuts, Java language itself.
  • Soft skills vary every time use them. Development is a soft skill. Rely on pattern recognition. Different each time. Speaking is a soft skill too.

For mid (3-10 years)

  • “grow without doing anything”. People give you things to do and you grow by doing them.
  • 2/3 developers think easy to get a job equivalent to one have right now
  • Don’t typically worry about career at this point.
  • Sometimes get stuck though. ex: job without opportunities to learn

Career plateau (10+ years)

This was most of the audience.

  • Not bad. Means grew a lot.
  • Now have to figure out what next.
  • Don’t get discouraged that nothing happens for a few years
  • Different for ever person
  • We get comfortable and then realize something is wrong. So being comfortable becomes uncomfortable

Audience concerns

  • Team uses legacy technology
  • Not going to be marketable
  • Got stuck doing something very good at, but how do something new
  • Not growing for several years
  • Complacency
  • Take charge of career (vs having something happen to you)
  • Be recognized (control how people see you)
  • Don’t feel comfortable working with someone don’t trust
  • Want to to be a manager/architect (when manager, dev skills atrophy(
  • Don’t have opportunity
  • Be relevant
  • Stay on tech side without becoming a manager
  • Discomfort on how to break through plateau

“You don’t die, but your brain thinks you will” – getting over fear of speaking/teaching

  • Asked who was shy/scared of speaking in front of people. Then dragged one up on stage. Had a conversation with him up there and then him talk about a comfortable topic (what like about java) while looking at audience. Asked if could teach a student about Java. He said it was hard initially but got used to it.
  • Then asked a second person to try. That person knew what was coming. This time, he emphasized looking at the audience as they spoke. Had audience intentionally ask a hard question. He did a good job saying would research and get back on it.
  • All know enough to teach someone something. All don’t know enough to teach a different topic.
  • People come to a presentation for a topic they want to learn about.
  • Ok to recover after make a mistake

Know what want

  • Often feel uncomfortable because don’t have new objectives. Think big.
  • Need to know what want. Might have already achieved it.
  • Infinite amount of things to learn. Will never get to 100% of knowledge.
  • Know what want overall in life; not just about tech

Share what know

  • Learning how to share is a skill common across everyone
  • Testimonial from Rodrigo
  • Helping enough other people helps you
  • ex: you are stuck doing legacy code because nobody else knows what you do. or why new tech is important [seems oversimplified; maybe because ran out of time?]

My take: I like that they covered a lot of information before doing the intros. I also like that they tied the session to the audience. It was interesting hearing all the audience concerns/questions. Hearing the variety of problems and hearing your own is helpful. Even if it is “just” for dealing with imposter syndrome :). I think he could have spent a tiny bit less time on audience interaction and finished.