Saturday, August 8, 2020

2019 Subaru Ascent Gripes

 

2019 Subaru Ascent Gripes

Gripes after two months and 1300 miles:

The startup screen

This screen appears and remains for ten seconds every time I start the car.  There is a big green button at the bottom that says something like “I Agree”, but does not dismiss the screen when you tap it.  I wish I could hack the software and remove this.

Can’t change the volume for 30 seconds after starting

All controls on the stereo are unresponsive for at least thirty seconds after starting the car, so you and your passengers are all stuck listening to whatever it happens to be.  And there is no feedback if you do turn the volume knob up, so it will blast when the volume finally changes.

Blue smoke from the exhaust

At least four times in the first 1000 miles I saw thick blue smoke from the exhaust pipes for a few seconds after starting cold.  And this was only when the wind was blowing gently from front to back, so there may have been other times I didn’t notice.  I know what causes this: an oil ring on a cylinder that isn’t seated properly that allows oil to get into the combustion chamber.  The oil gets burned and comes out as blue smoke.  But this engine is not a new design--it’s the same boxer engine Subaru has made for years.

Gas pedal lag

This is a drive-by-wire car--there is no cable connecting the gas pedal to the engine--and every time I want to accelerate quickly there is a lag between pushing hard on the gas pedal and acceleration.  Oh, you wanted to go faster?  Let me think about that.

Engine racing after right-turning merge

At least three times after coming out of a right-turning loop to merge into traffic, pushing hard on the accelerator resulted in an initial lag (see above) and then the engine remained at 4000 rpm even after taking my foot off the gas.  But the car stopped accelerating, so the engine was disconnected from the wheels, like it was in neutral.  It took a few seconds for the engine to return to normal.

Reboot required

A few weeks ago the motorized rear lift gate refused to open, so I followed the instructions in the user guide and opened it manually.  Then it refused to close properly, even after following the instructions to reset it.  So I closed it manually and verified that it latched, and then the car beeped at me when I tried to drive.  So I disconnected the negative terminal on the battery and left it disconnected for a minute.  The problem disappeared after reconnecting the battery, and only the clock needed to be reset (all stereo settings were retained).

Saturday, November 9, 2019

Heavier Cars are Safer

My dad used to tell me that heavier cars are safer, but he didn't have data to back up his claim.  There's an excellent article on Edmunds.com about the relationship between vehicle size, age, and safety.  They used data from IIHS, which publishes driver death rates by make and model.  This data is a better predictor of safety because it relies on real-world statistics rather than artificial crash tests.  A crash test attempts to predict what will happen, but IIHS has historical data that shows what really happened.

In this post, I add another variable that is missing from the IIHS data: curb weight.  I got the curb weight for each model from Edmunds.com, which provides easy-to-manipulate URLs in the following format:

https://www.edmunds.com/{make}/{model}/{year}/features-specs/

then search the page for "curb" to quickly find the curb weight.

Below is the resulting scatter plot of curb weight versus driver death rates:



You can see by looking at the plot that heavier cars generally have lower driver death rates, and a trend line automatically generated by Excel (not shown above) shows that one fewer driver dies (per million registered years) for every seventeen additional pounds of weight.

Friday, February 20, 2015

Keyboard shortcuts for Pandora One, iTunes, and Amazon Music

Below is a script that I have been using successfully for months on Windows 7 that controls play, pause and volume from keyboard shortcuts. It relies on AutoHotKey. All three music players work exactly the same way with the same set of keyboard shortcuts so they quickly become second nature. Only one music player should be running at a time.

I got this script from here and then modified it to work with iTunes and Amazon Music.

; This script exposes control of the pandora app to external keypresses
; It is a modified version of the script found on Chris DeLashmutt's blog,
; "Grog's Blog" - http://groggluebutt.blogspot.com/2009/02/official-pandora-desktop-and-hotkey.html
;
; His version of the script failed to work with Pandora One 2.0.0, with a few simple modifications
; I was able to get it to work.  The script should be able to modified easily to change the hotkeys
; to anything that is desired, for more information check out the documentation at http://www.autohotkey.com/
;
;
; Ctrl-Win-Alt-Right Arrow (or Next Media Key), Skip song
; Ctrl-Win-Alt-Up Arrow, Volume Up
; Ctrl-Win-Alt-Down Arrow, Volume Down
; Ctrl-Win-Alt-Space (or Play/Pause Media Key), Pause/Resume Playing
; Ctrl-Win-Alt-Plus (or + on Numeric Keypad), Thumbs up a song
; Ctrl-Win-Alt-Minus (or - on Numeric Keypad), Thumbs down a song
; Ctrl-Win-Alt-O, Activates and Pandora application window if minimized
; Ctrl-Win-Alt-M, Minimize the Pandora application window
; Ctrl-Win-Alt-X, Closes Pandora
; 
; Any future updates can be found at http://notunusual.net/pandoraone_autohotkey/
;
; Revision History
; Version 1.4 10/29/2012 - Added media key support for play/pause and skip/next track.
; Version 1.3.1 5/23/2012 - Fixed a strange issue where if you minimized, then restored the window through the 
;        script the window would be visible, but wasn't gaining focus so you couldn't interact with it
; Version 1.3 5/1/2012 - Added the ability to active and minimize the pandora window, made the close command actually close pandora
; Version 1.2.1 10/16/2011 - Fixed an issue where commands were being sent to any open Adobe AIR window, not just Pandora One
; Version 1.2 12/9/2010 - Added a hot key to shutdown pandora
; Version 1.1 - Added the ability to have the script work if the window is minimized/hidden thanks to Jeremy Hurwitz for sending me this tip

; Make the script work even if the window is hidden
DetectHiddenWindows, on

; Only allow a single instance of the script
#SingleInstance


; get the window title

DoesPandoraExist()
{
 IfWinExist, Pandora
 {
  IfWinExist, ahk_class ApolloRuntimeContentWindow
  {
   return true
  }
 }
 return false

}

DoesITunesExist()
{
 IfWinExist, ahk_class iTunes
 {
  return true
 }
 return false

}

DoesAmazonExist()
{
 IfWinExist, ahk_class Amazon Music
 {
  return true
 }
 return false

}

; Ctrl-Win-Alt-Right Arrow, Skip song
Media_Next::
^#!Right::
If DoesPandoraExist()
{
 ControlSend, , {RIGHT} ; Next
}
If DoesITunesExist()
{
 ControlSend, , ^{RIGHT}  ; > next
}
If DoesAmazonExist()
{
 ControlSend, , ^{RIGHT}  ; > next
}
return

; Ctrl-Win-Alt-Up Arrow, Volume Up
^#!Up::
If DoesPandoraExist()
{
 ControlSend, , {UP} ; VolUp
}
If DoesITunesExist()
{
 ControlSend, , ^{UP}  ; vol up
}
If DoesAmazonExist()
{
 ControlSend, , ^{UP}  ; vol up
}
return

; Ctrl-Win-Alt-Down Arrow, Volume Down
^#!Down::
If DoesPandoraExist()
{
 ControlSend, , {DOWN} ; VolDown
}
If DoesITunesExist()
{
 ControlSend, , ^{DOWN}  ; vol down
}
If DoesAmazonExist()
{
 ControlSend, , ^{DOWN}  ; vol down
}
return

; Ctrl-Win-Alt-Space, Pause/Resume Playing
Media_Play_Pause::
^#!Space::
If DoesPandoraExist()
{
 ControlSend, , {SPACE} ; PlayToggle
}
If DoesITunesExist()
{
 ControlSend, , {SPACE}  ; play/pause toggle
}
If DoesAmazonExist()
{
 ControlSend, , {SPACE}  ; play/pause toggle
}
return

; Ctrl-Win-Alt-Plus, Thumbs up a song
^#!NumpadAdd::
^#!+::
If DoesPandoraExist()
{
 ControlSend, ahk_parent, {NumpadAdd} ; ThumbsUp
}
return

; Ctrl-Win-Alt-Minus, Thumbs down a song
^#!NumpadSub::
^#!-::
If DoesPandoraExist()
{
 ControlSend, , - ; ThumbsDown
}
return

; Ctrl-Win-Alt-X, Closes the window
^#!X::
IfWinExist, Pandora
{
 WinKill ; Close Window
}
return

; Ctrl-Win-Alt-O, Activate the window
^#!O::
If DoesPandoraExist()
{
 WinShow   ; Show the window
 WinActivate  ; Activate Window
}
return

; Ctrl-Win-Alt-M, Minimize the window
^#!M::
If DoesPandoraExist()
{
 WinHide  ; Hide instead of minimize Window, it does somethign strange if we activate it after minimizing it
}
return

Tuesday, June 15, 2010

ehcache relies on slf4j

I couldn't get my unit tests to run from my Ant task after switching to ehcache for Hibernate. Every test would fail with the following error:
java.lang.NoClassDefFoundError: Could not initialize class net.sf.ehcache.hibernate.EhCacheProvider
I followed the instructions in this blog entry to pretty print the classpath and confirm that ehcache.jar was indeed on the Junit test classpath. The application runs fine inside the app server, so what gives?

I solved the mystery by modifying my test so that it only ran one line of code:
System.out.println(Class.forName("net.sf.ehcache.hibernate.EhCacheProvider").newInstance());
This gave me a more useful error message:
java.lang.NoClassDefFoundError: Could not initialize class org.slf4j.LoggerFactory
Aha! I didn't have jboss-home/common/lib/sfl4j-api.jar on my classpath. I added it and one other slf4j jar to my classpath and my problem was solved.

There goes two hours due to a misleading error message.

Thursday, June 10, 2010

XPlanner+ installation

How to install a private instance of XPlanner+ on JBoss 5.1.0.  These instructions assume that you have already downloaded and unzipped JBoss AS 5.1.0.
  • Download the WAR file from the XPlanner+ web site.
  • Expand the WAR file into a new folder within <jboss_home>/server/default/deploy, and then rename the folder xplanner-plus.war
  • Delete <jboss_home>/server/default/deploy/xplanner-plus.war/WEB-INF/lib/xml-apis-1.0.b2.jar because this causes a deployment failure with the following error:
    java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl  cannot be cast to javax.xml.parsers.DocumentBuilderFactory
  • Start JBoss using <jboss_home>/bin/run -b 0.0.0.0 so that the application is available from other machines. The default behavior for JBoss is to only serve pages to localhost.
The current version of XPlanner+ creats an in-memory HSQLDB instance that is fast and requires no configuration.  It also persists the data on a clean server shutdown by updating <jboss_home>/bin/hsqldb/xplanner.script.  If the server is abruptly shutdown then it reconstructs the data from <jboss_home>/bin/hsqldb/xplanner.log.  It's a simple and effective scheme and it makes moving the data to another relational database relatively easy because xplanner.script contains both the DML and the DDL to recreate the entire database. One disadvantage is that you cannot connect to the database from an external JDBC tool.

Thursday, March 4, 2010

iPhone with a prepaid plan

I liked the iPhone the first time I saw it, but I never could rationalize spending $80/month for service because I spend less than $8/month with a T-mobile prepaid plan.  Then I read a comment on an article about Google's Nexus One that said you can use a T-mobile SIM card in the iPhone because they both use GSM.  So I purchased a used iPhone 2G (I don't need 3G because I don't have a cellular data plan), unlocked the phone, and inserted my T-mobile SIM.  It works!  I have been using it since mid-January and I love it.  I don't miss the cellular data plan because there are lots of free Wi-Fi hotspots, and I don't really want to be "plugged in" all the time.

A few weeks later my mom asked me for a cell phone recommendation, and she has an AT&T GoPhone prepaid plan.  I thought a locked iPhone might work because it's AT&T, but I had to help unlock hers also.

I had to cobble together instructions and downloads from several sources, so I collected them in this blog entry in case I need to do the same thing again.

I tried unlocking the phone with version 3.1.2 software but BootNeuter didn't work, and I found that others had the same problem.  The most concise summary of the approach is provided in a comment from SOLUTION!!!, but there were no links.  So here are the instructions for Windows, step-by-step, with links:
  1. Buy a used 2G iPhone.  It doesn't matter what version of software it has.  If you buy one that is already unlocked then you can skip to the last step.
  2. Create a new folder for the following downloads:
    1. Download the 3.0 IPSW software for iPhone (not 3G) from here.
    2. Download RedSn0w 0.7.2 for Windows and unzip it.
    3. Download BL-39.bin and BL-46.bin
  3. Perform a DFU restore as follows:
    1. Plug the iPhone into your computer
    2. Launch iTunes
    3. Press and hold both the power button and the home button for 10 seconds, then release the power button only and continue to hold the home button until your computer says something about recognizing a DFU device.
    4. In iTunes, click the restore button while holding down the shift key.  
    5. You should see a dialog that allows you to select the IPSW file you downloaded.
    6. Wait for the iPhone to be restored to 3.0.
  4. Run RedSn0w and follow the instructions.  Select your downloaded IPSW and bin files when prompted.  Make sure you check the box to unlock the phone.
  5. Insert your SIM card by pushing the end of a paperclip into the paperclip-sized hole at the top of your iPhone, adjacent to the headphone jack.
Enjoy using your iPhone with a prepaid plan.  I like T-mobile because you can buy 1000 minutes for $100 and they don't expire for a year.  And if you're like me and you don't even use that many minutes in a year then you can add $10 just before they expire and you get another year.  That's $55 per year, or about $4.50 a month, including all taxes and fees.

System.nanoTime() does not always return a value greater than the previous call

 
-----Original Message-----
From: IncidentDaemon@sun.com [mailto:IncidentDaemon@sun.com]
Sent: Wednesday, October 14, 2009 1:52 PM
To: John Amos
Subject: Your Report (Review ID: 1630000) - System.nanoTime() does not always return a value greater than the previous call

************************************************
Dear Java Developer,

Thank you for your interest in improving the quality of Java Technology.

Your report has been assigned an internal review ID of 1630000, which is NOT visible on the Sun Developer Network (SDN).

Please be aware that the large volume of reports we receive sometimes prevents us from responding individually to each message.

If the information is determined to be a new Bug or RFE, or a duplicate of a known Bug or RFE, you will receive a followup email containing a seven digit bug number.  You may search for, view, or vote for this bug in the Bug Database at http://bugs.sun.com/.

If you just reported an issue that could have a major impact on your project and require a timely response, please consider purchasing one of the support offerings described at http://developers.sun.com/services/.

The Sun Developer Network (http://developers.sun.com) is a free service that Sun offers. To join, visit http://developers.sun.com/global/join_sdn.html.

For a limited time, SDN members can obtain fully licensed Java IDEs for web and enterprise development.  More information is at http://developers.sun.com/prodtech/javatools/free/.

Thank you for using our bug submit page.

Regards,
Java Developer Bug Report Review Team



---------------------------------------------------------------


Date Created: Wed Oct 14 14:52:15 MDT 2009
Type:        rfe
Customer Name:   John Amos
Customer Email:  ***@****.***
SDN ID:      
status:      Waiting
Category:    java
Subcategory: classes_lang
Company:     ******
release:     5.0
hardware:    x86
OSversion:   windows_2003
priority:    4
Synopsis:    System.nanoTime() does not always return a value greater than the previous call
Description:
 A DESCRIPTION OF THE REQUEST :
On some systems with VMWare 2.5.x, the difference between two calls to System.nanoTime() is negative (t1 - t0 < 0).  AbstractQueuedSynchronizer assumes this will never happen.



JUSTIFICATION :
While it is valid to claim that this a defect in VMWare and/or Windows and/or the hardware, it is also irrelevant.  System.nanoTime() should be written defensively, so that it can never return a value that is less than the value from the previous call.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
System.nanoTime() should never return a value that is less than the value from the previous call.  If that isn't possible on the host platform, then this method should write an error message to the console.  The current behavior of failing silently is not acceptable.
ACTUAL -
Runnables that are in the queue of a ScheduledThreadPoolExecutor never run because AbstractQueuedSynchronizer.awaitNanos() is in an infinite loop.  I confirmed using a debugger that the expression (now - lastTime) in this method evaluates to a negative number.

---------- BEGIN SOURCE ----------
now - lastTime evaluates to a negative number in the following method from AbstractQueuedSynchronizer, which is used by ScheduledThreadPoolExecutor.

public final long awaitNanos(long nanosTimeout) throws InterruptedException {
            if (Thread.interrupted())
                throw new InterruptedException();
            Node node = addConditionWaiter();
            int savedState = fullyRelease(node);
            long lastTime = System.nanoTime();
            int interruptMode = 0;
            while (!isOnSyncQueue(node)) {
                if (nanosTimeout <= 0L) {
                    transferAfterCancelledWait(node);
                    break;
                }
                LockSupport.parkNanos(nanosTimeout);
                if ((interruptMode = checkInterruptWhileWaiting(node)) != 0)
                    break;
                long now = System.nanoTime();
                nanosTimeout -= now - lastTime;
                lastTime = now;
            }
            if (acquireQueued(node, savedState) && interruptMode != THROW_IE)
                interruptMode = REINTERRUPT;
            if (interruptMode != 0)
                reportInterruptAfterWait(interruptMode);
            return nanosTimeout - (System.nanoTime() - lastTime);
}


---------- END SOURCE ----------
workaround: 
comments: