12 October 2020

Quantum Computing Experience

Opportunity for Quantum Computing class - Applicants will be accepted on a rolling basis in two rounds, beginning October 9 and October 15, so the time is right to apply right now.

This opportunity is open for free to high school students and above and is provided by a combination of MIT, Oxford University and IBM's open source Qiskit open source quantum software development kit.

Article announcing the program: The announcement

Java Updates

Java 15 has been released. The easiest way to get it is to go to adoptopenjdk.net which has an easy-to-use installer for all platforms. Java 15 supports Python-style triple-quoted strings. If you update to this, also update JavaFX to 15. You are fine if you have 13 or later.

I have updated the JavaFX instructions in the resources area. Get this installed and tested; there are complete instructions for all platforms.

Homework Get this working.

Java Regexes

These are implemented in the package java.util.regex. Here are the contents.

ItemDescription
MatchResultThis interface specifies two versions of each of the methods start(), group(), and end().
MatcherThis class implements MatchResult and it performs match operations based on a Pattern.
PatternThis class has a static method compile, which works much like Python's re.compile() It has an instance method matcher(String s) which returns a Matcher for the regex in the Pattern for the string s.
PatternSyntaxExceptionThis is a runtime exception thrown when there is a syntax error in a regex pattern.

Quick Review of Regexes

List Character Classes This is the most basic type of character wildcard.

[abcqf]  - character wildcard matches any of a b c q f
[a-z] - any lowercase letter ( - is a metacharacter herre)
[A-Z] - any uppercase letter
[0-9] - any decimal digit
[0-9a-fA-F] - any hex digit.
Metchars - is a range \ toggles magic  ^ at the beginning is NOT, [ and ]
[^a-z]  - anything BUT a-z.

Character Classes

\d any decimal digit  [0-9]
\D anything but a deciaml digit
\w any word character [a-zA-Z0-9_]
\W anything BUT a  word character
.  any character except newline
\s any whitespace
\S any non-whitespace

Regular Expressions and Juxtaposition

Juxtapositoin means "and then immediately"

[a-z][0-9]
US Phone numbers

[2-9]\d\d-[2-9]\d\d-\d\d\d\d

Multiplicity Operators These are postfix unary operators and they have greater precedence than juxtaposition.

* zero or more of
+ one or more of
? one or none
{n} exactly n of
{n,} at least n of
{m, n} at least m but not more than n of
US Phone numbers

[2-9]\\d{2}-[2-9]\\d{2}-\\d{4}

Social security number

\\d{3}-\\d{2}-\\d{4}