We had an aviation and computers club in high school. The student that led the club was very knowledgeable about all sorts of aircraft and their capabilities. I have recently been learning more about the V-22 Osprey and thought I might as well save links to the more informative videos I’ve watched. It is this exercise that reminded me of that high school club. There are many videos on the V-22 out there. The video below provides a good introduction to the V-22, perhaps the most recognizable tilt rotor aircraft out there.
The V-22 Osprey: US Most Advanced Hybrid Aircraft Ever Built
One of the things I particularly liked about the video below was that it showed engineers working on aircraft models (e.g. propellers) in SolidWorks. Here’s a screenshot of a SolidWorks model at about 14:42 into the video above.
Another interesting video on the V-22 is this one from Business Insider. I like that it presents a bit more about the operational aspects of how the marines use the V-22.
Unfortunately, there have been many fatal accidents involving the V-22 Osprey. Ward Carroll discusses this troubled history and how the program made it through to today, at which point the V-22s have been grounded.
Chemistry Basics I covered the sections on scientific discovery up to atomic theory. Next is the question of what atoms are made of. Enter JJ Thomson with his CRT experiments. These 3 videos explain his discovery of the electron. I watched multiple just to see different perspectives on the same experiment.
It was after watching the next one that I found myself wondering how you pump all the air out of a glass bottle.
Discovery of the Electron: Cathode Ray Tube Experiment
JJ Thomson and the discovery of the electron
After it had been established that electrons exist and that they have negative charge, it naturally follows that we would want to know what the charge on an electron actually is. This was resolved by Millikan’s oil drop experiment.
This next video on the oil drop experiment was helpful because it showed a similar but modern setup.
The discovery of electrons, combined with the fact that matter is in general electrically neutron implies that there must be positively charged particles. Ernest Rutherford’s gold foil experiment confirms this:
At this point I have several questions that will have to wait for another time.
How are magnets made (e.g. the ones used by J.J. Thomson)?
How were alpha particles Rutherford was using discovered?
How was it shown that the electrons move around the nucleus?
It’s been over 20 years since I last studied chemistry. I started reading General Chemistry: Atoms First. It has an introductory chapter 0 that goes over concepts like fundamental units and conversion between units. A mention of the amount of volcanic material ejected into the atmosphere by the Krakatoa volcanic erruption piqued my curiosity enough to watch this History channel video.
Krakatoa: Devastating Explosion | How the Earth Was Made (S1, E3) | Full Episode | History
Digging into chapter one opened my eyes to the fascinating journey of many scientists through the centuries trying to understand the world, and more specifically, elements. Accounting for the similarities between many of the elements was an undertaking that got a breakthrough in Dmitri Mendeleev’s periodic table as explained in the next video.
The genius of Mendeleev’s periodic table – Lou Serico
Reading about the isolation of oxygen from mercury oxide by Joseph Priestley made me curious about how this was done. Thankfully, there are many informative videos on these topics. Here’s one on the isolation of oxygen.
The Discovery of Oxygen & Combustion 1946 Educational Film 76244
This video has left me wondering where HgO came from – was it a compound they used for something else?
Antoine Lavoisier soon afterwards demonstrated the law of mass conservation.
Joseph Proust followed with the law of definite proportions.
John Dalton capped off the line of inquiry with the law of multiple proportions.
Searching for Joseph Proust on YouTube leads me to this interesting video with some of this history.
The Creation of Chemistry – The Fundamental Laws: Crash Course Chemistry #3
I wish I had all these videos as a tool when I was learning chemistry years ago.
I have learned about various software packages this year. One of them is SolidWorks 2023. The tutorials I worked through started with how to model a flange. I figured I should probably know exactly what these are used for. Here’s a good video explaining what flanges are and the various types of flanges.
Piping Flange Types, Faces, and Surfaces – Explained!
One of the concepts introduced in this video is a gasket. I’ve heard the term used a lot but never really paid attention to exactly what a gasket is. This was a helpful breakdown of gaskets: Types of gaskets and gasket fundamental. – YouTube.
I’m reading through Venkatesan Guruswami’s thesis titled List Decoding of Error-Correcting Codes and the definition of infinite families of codes uses lim inf. These videos are a good reminder of how the superior and inferior limits are defined.
Real Analysis 11 | Limit Superior and Limit Inferior
Real Analysis 12 | Examples for Limit Superior and Limit Inferior
While we’re at it, why not review vector spaces since they are used in the definition of linear error correcting codes?
I have been learning a little bit about how things are made. One of the important concepts that is emphasized is GD&T. Here are the YouTube videos I found explaining what it is and why it is important.
Understanding GD&T
The next playlist was particularly interesting to me because of the discussion in one of the videos about how mechanical engineers often graduate without a basic knowledge of GD&T, which can set them back when they get into the industry.
I recently bought a 3D printer for some SolidWorks 2023 models I have been working on. I was reading through the applications of SolidWorks but was struggling to motivate myself to read through the overview of 3D printing technologies. I was therefore thrilled to find this series on Material Science in Additive Manufacturing: Basics. These are the technologies I reviewed (with the first two videos embedded at the end of this post):
Skipping the package repository setup step will result in these errors (seen on x64 5.10.102.1-microsoft-standard-WSL2 but all other steps and output are from a VM):
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'docker-ce' has no installation candidate
E: Unable to locate package docker-ce-cli
E: Unable to locate package containerd.io
E: Couldn't find any package by glob 'containerd.io'
E: Couldn't find any package by regex 'containerd.io'
E: Unable to locate package docker-buildx-plugin
E: Unable to locate package docker-compose-plugin
I list the available containers by running docker ps and there are none, but this verifies that docker is working.
saint@ubuntuvm:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
saint@ubuntuvm:~$
The hello-world image runs successfully as well.
saint@ubuntuvm:~$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
719385e32844: Pull complete
Digest: sha256:88ec0acaa3ec199d3b7eaf73588f4518c25f9d34f58ce9a0df68429c5af48e8d
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
saint@ubuntuvm:~$
Running Docker in WSL
I followed the above steps to install docker in my Windows Subsystem for Linux Ubuntu 22.04.2 LTS environment. Unfortunately, docker ps does not work.
saint@mymachine:~$ sudo docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
saint@mymachine:~$
To change the active code page, go to Control Panel > Region. Click on the “Change system locale…” button in the Administrative tab.
The Region Dialog Box
The Region Settings dialog will pop up. Select a different locale e.g. Japanese (Japan).
Reboot when prompted. You can verify (even before rebooting) that the active and OEM code pages have changed. Locales like Kiswahili (Kenya) and English (India) did not change the code page values (and therefore didn’t prompt to reboot).
After rebooting, I delete the build directory then configure and build OpenJDK again. This time the build fails with these errors:
ERROR: Build failed for target 'images' in configuration 'windows-x86_64-server-slowdebug' (exit code 2)
Stopping javac server
=== Output from failing command(s) repeated here ===
* For target hotspot_variant-server_libjvm_gtest_objs_test_json.obj:
test_json.cpp
d:\java\forks\jdk\test\hotspot\gtest\utilities\test_json.cpp(357): error C2143: syntax error: missing ')' before ']'
d:\java\forks\jdk\test\hotspot\gtest\utilities\test_json.cpp(355): error C2660: 'JSON_GTest::test': function does not take 1 arguments
d:\java\forks\jdk\test\hotspot\gtest\utilities\test_json.cpp(49): note: see declaration of 'JSON_GTest::test'
d:\java\forks\jdk\test\hotspot\gtest\utilities\test_json.cpp(355): note: while trying to match the argument list '(const char [171])'
d:\java\forks\jdk\test\hotspot\gtest\utilities\test_json.cpp(357): error C2143: syntax error: missing ';' before ']'
d:\java\forks\jdk\test\hotspot\gtest\utilities\test_json.cpp(357): error C2059: syntax error: ']'
d:\java\forks\jdk\test\hotspot\gtest\utilities\test_json.cpp(357): error C2017: illegal escape sequence
d:\java\forks\jdk\test\hotspot\gtest\utilities\test_json.cpp(357): error C2059: syntax error: ')'
d:\java\forks\jdk\test\hotspot\gtest\utilities\test_json.cpp(363): error C2143: syntax error: missing ')' before ']'
d:\java\forks\jdk\test\hotspot\gtest\utilities\test_json.cpp(361): error C2660: 'JSON_GTest::test': function does not take 1 arguments
d:\java\forks\jdk\test\hotspot\gtest\utilities\test_json.cpp(49): note: see declaration of 'JSON_GTest::test'
d:\java\forks\jdk\test\hotspot\gtest\utilities\test_json.cpp(361): note: while trying to match the argument list '(const char [174])'
d:\java\forks\jdk\test\hotspot\gtest\utilities\test_json.cpp(363): error C2143: syntax error: missing ';' before ']'
d:\java\forks\jdk\test\hotspot\gtest\utilities\test_json.cpp(363): error C2059: syntax error: ']'
... (rest of output omitted)
* All command lines available in /cygdrive/d/java/forks/jdk/build/windows-x86_64-server-slowdebug/make-support/failure-logs.
=== End of repeated output ===
No indication of failed target found.
HELP: Try searching the build log for '] Error'.
HELP: Run 'make doctor' to diagnose build problems.
The Visual C++ compiler’s behavior when reading source files depends on whether or not source files have a byte-order mark.
By default, Visual Studio detects a byte-order mark to determine if the source file is in an encoded Unicode format, for example, UTF-16 or UTF-8. If no byte-order mark is found, it assumes that the source file is encoded in the current user code page, unless you’ve specified a code page by using /utf-8 or the /source-charset option.
This can be easily tested using hexdump in Cygwin. Launch notepad and open the test.txt file created by these commands. The File > Save as dialog has an Encoding dropdown that write a byte-order marker for any of the UTF options. Running hexdump will display the byte-order markers.
echo abc123 > test.txt
hexdump -C test.txt
Inspect the OpenJDK source file failing to build confirms that there is no BOM in the file. (can this be done on GitHub?)
diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4
index c0c78ce95b6..bbb0426c368 100644
--- a/make/autoconf/flags-cflags.m4
+++ b/make/autoconf/flags-cflags.m4
@@ -560,7 +560,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
TOOLCHAIN_CFLAGS_JVM="-qtbtable=full -qtune=balanced -fno-exceptions \
-qalias=noansi -qstrict -qtls=default -qnortti -qnoeh -qignerrno -qstackprotect"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
- TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -MP"
+ # The -utf8 option sets source and execution character sets to UTF-8 to enable correct
+ # compilation of all source files regardless of the active code page on Windows.
+ TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -MP -utf-8"
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -Zc:wchar_t-"
fi
The build still fails but this time the error is from the java.desktop tree.
ERROR: Build failed for target 'images' in configuration 'windows-x86_64-server-slowdebug' (exit code 2)
=== Output from failing command(s) repeated here ===
* For target support_native_java.desktop_libfreetype_afblue.obj:
afblue.c
d:\java\forks\jdk\src\java.desktop\share\native\libfreetype\src\autofit\afblue.c(1): error C2220: the following warning is treated as an error
d:\java\forks\jdk\src\java.desktop\share\native\libfreetype\src\autofit\afblue.c(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
d:\java\forks\jdk\src\java.desktop\share\native\libfreetype\src\autofit\afscript.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
d:\java\forks\jdk\src\java.desktop\share\native\libfreetype\src\autofit\afblue.c(257): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
... (rest of output omitted)
* For target support_native_java.desktop_libfreetype_afcjk.obj:
afcjk.c
...
Let us try using JITWatch on the sample Factorization program I have been using to learn about systems performance. Use these instructions from that blog post to get JITWatch:
git clone https://github.com/AdoptOpenJDK/jitwatch.git
cd jitwatch
mvn clean package
# Produces an executable jar in ui/target/jitwatch-ui-shaded.jar
java -jar ui/target/jitwatch-ui-shaded.jar
Start the factorization sample application such that a hotspot log file is generated. To do so, use the flags listed in the JITWatch Instructions · AdoptOpenJDK/jitwatch Wiki (github.com). I decide to redirect the output to a file to avoid filling the script with the additional logging output.
Click on the “Open Log” button in JITWatch then select the hotspot*.log file. Next, click on the Start button to process the JIT log.
Opening a HotSpot Log FileProcessed HotSpot LogViewing JIT-compiled Class Members
Clicking on a class member opens another window with the corresponding assembly instructions generated by the JIT. I haven’t set up any source code locations but the assembly instructions are still displayed.
Setting up MVN on Windows
To run JITWatch on Windows, download the Maven binaries from Maven – Download Apache Maven and verify the hashes using certutil. Extract the downloaded .zip file using tar. Here are the instructions I used in Git Bash.
mkdir -p /c/java/binaries/apache
cd /c/java/binaries/apache
curl -Lo apache-maven-3.9.3-bin.zip https://dlcdn.apache.org/maven/maven-3/3.9.3/binaries/apache-maven-3.9.3-bin.zip
certutil -hashfile apache-maven-3.9.3-bin.zip SHA512
# shasum -a 512 apache-maven-3.9.3-bin.zip
tar xf apache-maven-3.9.3-bin.zip