I’m estranged from my extended family because they’re mostly Trumpistas, and I have no desire to be the crazy uncle who shows up when there’s food; but I’m a fairly extreme introvert, so that’s actually OK with me.
It’s possible for me to get bored, however; so just for lulz, I decided to translate my rational number into Java.
I haven’t done any Java work since I retired, and so I don’t have javac on either the Windows or Linux partition on my home computer. It’s probably out there somewhere on the VPS that I rent, but I haven’t found it yet. The result is that, as I write this, the code hasn’t even been compiled, let alone tested; and we know how that can go.
If anybody out there might actually find this useful, would you care to be my tester? ð You’ll find the current version of the source in this ZIP archive.
Update: 2024-12-26 20:00−6:00: OK, I found javac on my VPS and, after fixing a bunch of stupid mistakes, got a clean compile. For the sake of my sanity, I’ve added the requirement that the one-argument Rational(double) not be passed a subnormal value; and I’ve put the new documentation and the ZIP file containing the new source at the links above. Now for some testing…
Update: 2024-12-28 09:00−6:00: I found some bugs just by desk checking the code some more, and I reorganized the documentation a bit. OK, now for some testing…
Update: 2024-12-30 20:30−6:00: OK, I think it’s done.
Katydid says
I’m on my phone and can’t test for you, but hoping you had a fun and engaging day sorting this out. Also, remember, you can’t pick your family. Think of what went right in your life and your genes that you aren’t a Trumper.
Here’s a little gift: I hear there’s talk of installing a high-speed train in the east. If they can make it work there, maybe they’ll spread the joy?
billseymour says
Katydid:
Maybe you’re thinking of replacing the Acela Express trainsets with newer equipment.
Amtrak has had the Acela Express trainsets for almost a quarter of a century. They’re capable of 150mph which technically qualifies as high-speed rail; but they hit that speed only for about 50 miles in Rhode Island and Massachusetts. In most places along the Northeast Corridor (D.C. to Boston), speeds are limited by track curvature* and older catenary**. The Acela trains have shorter end-to-end times than do the Northeast Regionals; but that’s almost entirely because the former make fewer stops.
*The trains can take most of the curves without derailing, but passengers would be bounced around if they did. The Acela Express equipment has active tilt which mitigates the passenger comfort issue; but a design change late in development increased the loading guage by, IIRC, an inch and a half; so they have to turn off the tilt to avoid banging into trackside structures along the way. (Yes, really.)
**On much of the route between D.C. and New York, the overhead wires are still fixed on their supports; so when it gets hot in the summer, the wires expand and lose tension; and the trains’ pantographs can pull the wires down if they run too fast. This would all have to be replaced with constant tension catenary which has weights at the ends of the wires.
I hope that wasn’t more than you wanted to know. ð
Katydid says
Bill, that was interesting (and appalling). When I was stationed in Japan, I rode the Shinkansen (bullet train) on vacation trips. I understand China has trains that go even faster than the Shinkansen. I’ve also ridden trains in Germany, Holland, and the UK. I know there’s a better way to run a railroad than what we’re doing in the USA.
You did make me laugh with the mental picture of a train rounding a curve and passengers going flying.
I’ve ridden the trains and subways in NYC and the subway in DC. I’ve flown to Atlanta for work and took the MARTA (their underground) directly to downtown Atlanta. I’ve even ridden the BART in San Francisco and I know it’s possible to have convenient public transportation–we just don’t have the will to do it.
moarscienceplz says
“Iâve even ridden the BART in San Francisco and I know itâs possible to have convenient public transportationâwe just donât have the will to do it.”
BART is the only system you listed that I have experience with, but “convenient” is not the word I would choose. I live in San Jose which is about 40 miles south of San Francisco. Because of that distance, and because San Jose is actually a larger city than SF, I really only go there for entertainment purposes, but the BART system has to close for several hours each night for maintenance, which means it is pretty much impossible to party at night in SF and still have a BART train available to get back home without spending the night in SF. On top of that, I have lived in SJ for nearly half a century, but until about two years ago, I had to drive 20 miles to access the closest BART station. So, I still needed a car for about half of my train journey. Finally, the geography of my area theoretically provides two paths between SJ and SF: a straight shot north up the SF peninsula, and a semicircle east and north through the East Bay and Oakland, then west through the Transbay tube into SF. Unfortunately, San Mateo county lies between me and SF, and they still won’t permit BART to come any further south than SF airport. I guess they think hordes of unwashed (i.e., Black) Oaklanders will invade their pristine (White) neighborhoods. So, I can only take the much longer eastern route between SJ and SF. For these reasons, I have only ridden BART about 5-10 times in 45 years.
Katydid says
@4, you just illustrated my point. Public transportation COULD be much better; we just don’t have the will to do it. I rode BART about 30 years ago, the summer I worked in Sunnyvale. When you’re in the city, it’s very convenient. I rode all over the city doing touristy stuff one day. The problem is getting from city to city, especially cities close to each other. Imagine the convenience of getting the train from San Jose to work in San Francisco.