SP Error while getting price guide : INVALID PARAMETER

While trying to retrieve https://www.bricklink.com/v2/catalog/catalogitem_pgtab.page?idItem=None&idColor=0&gm=0&gc=1&ei=0&prec=4&showflag=0&showbulk=0 I got the error “SP Error while getting price guide : INVALID PARAMETER” which means “data type mismatch” because ‘None’ should be a number

Programatic submission of Australia Post’s CN23 customs form

A number of major international destinations of packages now will only accept packages with electronic CN23 customs declaration. Normally, you’d do this by rocking up to the Post Office with your pre-addressed parcel, filling in a CN23 paper form, and have that transcribed into Australia Post’s computer system by the postal worker behind the counter. You can elect to receive SMS notifications of change of status (landed, delivered, etc) for 50c.

Australia Post also allows you to fill in the appropriate details on their website; if you do this, then you get a QR code sent to you via SMS (free) and email (free) which the postal worker scans in and all the details (your name and address, destination name and address, contents, etc) are attached to your package’s details without any error-prone re-keying. The downside of going down this path is the dismal website Aussie Post provides, a JavaScript heavy, painfully slow dog of a site that doesn’t cache your own address.

Once the QR code is scanned, and the postal worker checks everything with you, they’ll print out the CN23, get you to sign it , and then it gets attached to your parcel. Because the To and From addresses are on the CN23 form (and those details are in electronic form, associated with the barcode for the package), it’s perfectly acceptable to present an unaddressed package to the post office (make sure you can tell which package is which, if you go down this route).

One thing you need to be aware of: Australia Post hasn’t heard of Unicode. You absolutely can’t use any characters not in the ASCII character set, and even then a very limited range of them. Certain fields allow some characters, which in turn aren’t allowed in other fields.

One of the fields you can supply is the HS tariff code, which is an international standard group of codes to describe “stuff” – the Harmonised System Tariff code. The sourcecode below uses the code for “Toy, plastic construction” – you should use the code for what you’re actually sending. You can specify multiple HS codes. Dollar values are in decimal dollars, weights are in decimal kilograms.

After calling the Australia Post website with your customs declaration, it returns to you a base-64 encoded PNG of the QR code to present at the counter, and a base-64 encoded PDF of the CN23 form – there’s no point printing this out, because it’s not paid for yet; let the Post Office print it out with the postage on it. You’ll also get the PNG via email and SMS (free).

Here’s some Python to make this submission:


    AP_session = requests.Session()
    jsonFormData =  {"customDeclaration":{
      "label":{"source":"AEM","postagePaidIndicator":False,"eadIndicator":False},
      "parcelCharacteristics":{
        "productClassification":11,
        "dangerousGoodsIndicator":False,
        "returnInstructions":"Return By Most Economical Route",
        "confirmationMobileNumber":"0411111111",
        "content":[{
          "content":"HS traffic code name for your stuff",
          "contentQuantity":1,
          "contentUnitValue":subtotal,
          "totalContentValue":subtotal,
          "contentWeight":int(order["total_weight"])/1000,
          "hsTariff":"95030039",
          "contentCountryOfOrigin":"DK"
          }],
        "totalConsignmentValue":subtotal},
      "senderAddress":{"firstName":"Josh","lastName":"FromGeekrant.org",
        "addressLine":["11 Example St"],"suburb":"YourSuburbName","state":"VIC",
        "postcode":"3000","email":"addr@example.com",
        "phone":"0411111111","smsConfirmation":False,"countryCode":"AU"},
      "receiverAddress":{"firstName":CustomsString(order["label_address_name_first"]),
        "lastName":CustomsString(order["label_address_name_last"]),
        "countryCode":order["label_address_two_char_country_code"],
        "addressLine":CustomsAddress(order),
        "suburb":CustomsString(order["label_address_city"]),
        "state":CustomsString(order["label_address_state"]),
        "postcode":CustomsString(order["label_address_postal_code"]),
        "email":order["buyer_email"]}
    }}

    stopact = {"jsonFormData":json.dumps(jsonFormData) }
    result = AP_session.post(url='https://auspost.com.au/bin/form/stopact', 
      data=stopact, timeout=2)
    response = json.loads(result.text)
    result.raise_for_status()
    filename = "{}-customsQRcode.png".format(orderid)
    with open(filename, "wb") as fh:
      fh.write(base64.b64decode(response['qrCode']))
    filename = "{}-CN23.pdf".format(orderid)
    with open(filename, "wb") as fh:
      fh.write(base64.b64decode(response['label']))

LEGO Pick-a-brick container sizes, dimensions and capacity

There are three Pick A Brick containers – The 950ml tumbler, 475ml tumbler and 30ml lid. I have measured the volume of these containers using a 0.1g scale and water; I have high confidence in the measurements. Other measurements have been taken with callipers and rulers; I have lower levels of confidence in those numbers.

The lid’s stud (where you can store LEGO if you’re particularly cunning) is 48mm diameter and approximately 16mm deep – six studs in diameter by two studs deep. This means you can’t fit something six studs wide (48mm) into it, because LEGO bricks aren’t 0mm tall or long. You might be able to store one 1×6 plate if you jammed it in, as plastic objects are plastic (bendy).

The 475ml tumbler has a profile matching that of the 950ml tumber, cut off at the bottom. They share an opening of over 100mm. They both have an indentation that matches that in the lid, allowing stacking. The displacement of the indentation of the base is 55mm wide and has three strengthening piers projecting into the interior of the base.

The length of the interior wall top-to-bottom depth of the 475ml tumbler is 76mm; it can hold 1675 1×1 round plates. The top-to-bottom depth of the 950ml tumbler is 170mm.

Dear ABC: use English better

It’s been several years, but now it’s time to complain about the use of certain phrases by ABC News journalists:
– “Quote Unquote” is meant to surround what you’re quoting, not preface it. If you’re just going to preface it and use a different tone of voice, just use “Quote.” If you want to clearly signal the end of a quote, say “Unquote” at that part.
– All crimes happened in the past, and are thus historic. There is no such thing as historic rape. It’s rape. Find another way to communicate “very old”. Vintage rape? Much classier.
– If a court order or law forbids naming someone, then you “mustn’t” name them, not “can’t”. You can, but you’re just unwilling to go to jail for contempt. “can’t be named for legal reasons” is also wrong, but less wrong than “can’t”. I hope you’re not trying to avoid sounding like characters in Harry Potter and “He who mustn’t be named”
– Vehicle crashes are not best described as accidents. As reporters you don’t generally know at the time of reporting the intent of drivers, so it could well not be an accident. Try crash, collision, or even the bland “incident”.

And on another matter, could your staff stop editorializing misfortune? “The driver reversed and tragically didn’t see the three year old, who sadly died as a result” ought to be reported as “The driver reversed and didn’t see the three year old, who died as a result”

BrickLink API PushNotificationMethod Get Notifications callback semantics

The documentation for the BrickLink API PushNotificationMethod suggests that the data sent to the URL you registered on the BrickLink API Consumer Registration Page is sent to this URL (via a POST verb, by the way) and as such you don’t need to call Get Notifications. Given the body of the POST is empty, this is not right – what you instead need to do is use any POST to your registered URL as a prompt to call Get-Notifications. It’s probably best to periodically call it too, given “it does not guarantee delivery of all events” and doesn’t either based on my experience.

A notification to be created when:

  • Order
    • You received a new order.
    • Buyer updates an order status.
    • Items of an order are updated (added or deleted).
  • Message
    • You received a new message.
  • Feedback
    • You received a new feedback or reply

Also note: NULL fields are not included in the returned JSON. Some fields names don’t match the documentation (eg: drive_thru_sent instead of the documented sent_drive_thru).

Sonos memory capacity

There’s an excellent chart on Reddit (and a slightly different one on Sonos’s forum) plotting the amount of memory each Sonos device has built into it. This has increased over the years.

I thought I’d do a table with this info, but also with the year of release, and the new crop of devices just released.

And I’ve also added a column noting if each device supports voice commands (which take more memory) and is compatible with the new Sonos operating system S2, or whether users of these are stuck on S1.

(There are a few gaps which hopefully I’ll fill over time. And I’ve deliberately excluded non-playing accessories such as the Bridge and Controllers. For now I also haven’t included the Sub, which is not a standalone player.)

DeviceYears soldStorageMemoryVoice S2Replaced by
ZonePlayer 1002005-08??NoNoZonePlayer 120
ZonePlayer 802006-08??NoNoZonePlayer 90
ZonePlayer 120
aka Connect:AMP
2008-153232NoNoConnect:AMP (gen 2)
ZonePlayer 90
aka Connect
2008-153232NoNoConnect (gen 2)
Play:52009-153232NoNoPlay:5 (gen 2)
Play:32011-186464NoYes
Playbar2013-20128128NoYesArc
Play:12013-1764128NoYesOne
Play:5 (gen 2)2015-20256256NoYesFive
Playbase2017-20256256NoYesArc
Connect (gen 2)2015-19256256NoYesPort
Connect:AMP (Gen 2)2015-19??NoYesAmp
One2017-1910241024YesYesOne (gen 2) / One SL
Beam2018-10241024YesYes
Amp2019-10241024NoYes
One (gen 2)2019-10241024YesYes
Symfonisk Lamp2019-256512NoYes
Symfonisk Bookshelf2019-256512NoYes
Port2019-512512NoYes
Move2019-10241024YesYes
One SL2019-512512NoYes
Arc2020-40961024YesYes
Five2020-512512NoYes

There’s certainly a pattern there.

Devices with at least 64Mb storage and 64Mb memory can support S2, but others can’t.

Voice command support appears to require at least 1024 Mb of storage and the same of memory.

S2 was the first big move in the 15 years since the first devices were released that they left behind some legacy devices on an older version. (Though in 2018 they did do an update which dropped support for their CR100 controller, sold from 2005-09, and long replaced for most users by iPads and smartphones.)

S1 will continue to get security and bug fixes – but not new features. And those users can get a 30% voucher for upgrades (and still use the older devices if they want – initially Sonos’s unwise idea was to brick them, but they changed that scheme).

S2 has only been out for a few weeks, so it’s unclear how quickly new features will be added. And from a software development perspective, under the hood there may have been a great culling of legacy code, which might be good for performance and stability (not that either have been a big issue in my use of Sonos).

Hopefully it’s another decade or more before they decide to exclude more older devices from the latest and greatest.

Setting up a public facing webserver behind a Netcomm NF18ACV

Note: this will move your Broadband Router’s web-configuration to an unexpected port :8080, instead of the :80 your browser expects.

Navigate to Management | Access Control | Services then disable the WAN side HTTP service (why would you even expose this?), change the port for the LAN side to the Alternate HTTP port of 8080, and hit Apply/Save.

Navigate to Advanced Setup | NAT | Virtual Servers and hit Add. Select the correct interface, fill in the other details including the Web Server’s LAN address, ensure you’ve got Status: Enabled for the port forwarding, and hit Apply/Save.

Run up a trial HTTP server using something like
sudo python -m SimpleHTTPServer 80
and check for access from outside. Kill the server, because that isn’t safe for production use.

Micro Men

For those with nostalgia for the early 80s microcomputer scene, “Micro Men”, a dramatisation of the competitive environment around Cambridge between Acorn and Spectrum is terrific.

Turns out this was broadcast more than ten years ago now!

Sadly I don’t think it was ever broadcast outside the UK, and it never made it onto home video.

The Centre For Computing History marked this anniversary by getting some of the real people into a room to watch the program and comment on it:

You can also listen to a recent podcast with the screenwriter, Tony Saint – this was very enjoyable.

And another one with Steve Furber, who worked for Acorn at the time and was one of the designers of the BBC Micro. He talks about the project, with a fair bit of technical detail, and touches on the realism of the dramatisation.

Air conditioner upgrade

I can’t find any technical data on one of our two existing air conditioners. It’s 1960s through-window technology, and it seems it might be somewhere around 130% efficient. A run-of-the-mill air conditioner today is about 400% efficient. What I do know is, when that air conditioner runs our power consumption spikes 2kW; for the cooling we’re getting, this suggests we should be using 700W. It’s costing 40 cents/hour more to run than a modern unit, and it isn’t providing us with heating. It also sounds like a jet aircraft. We don’t use it much.

If it’s replaced with a $2000 unit, the payback is 5000 operating hours. It actually operates for something like 150 or 200 hours a year, so there’s a more than 25 year payback – which isn’t outlandish, given the existing unit is 50 years old now, but I will be surprised if a unit manufactured today survives that long.

Modern units come with DRED support.

Picking an air conditioner is… complex. We’ve taken our home off gas, so we need some kind of electric heating, which I expect to run daily for a number of hours for four months of the year, and the cooling side is something that will get much less use. So, where I live, I need to optimize my “heat pump” for heating performance – COP in the lingo.

As of March 2020, there are more than 3700 air conditioners with performance metrics listed by the Australian government. Thankfully this data is available is CSV format, so can be folded, sorted and mangled. 2000 can be eliminated because they’re not single-split units, so their efficiency will suck balls. Another 450 can be eliminated because they’re not the classic wall hung variety, so will be stupid expensive. Anything smaller than 3KW and larger than 5KW is badly sized for the areas I’m looking at, so now I’m at a “manageable” 300 units. Purging others for efficiency reasons, and I’m down to less than 80. I sort for COP, and start down the list.  The first is $2550, then $1420, then can’t be purchased anywhere, then $880 (a ten-year TCO of $3000, plus installation). A feature check confirms it can be set to a weekday operating cycle and a weekend cycle; we’re off to the races. I locate a supplier who will deliver two for $1,716.00 after trying the local retailer who refuses to answer the phone.

Now for the easy task: I’ve simply got to find a tradie to install my units.

Upgrading Win7 to Win10 with a non-standard Profiles location

Windows 7 has come out of mainstream support, so it’s definitely time to upgrade.

I’d held off because I like Windows Media Center, which isn’t available on Win10, though there is an unofficial method. More about that later.

The machine in question is an old Mac Pro 2008 that I got some years ago.

Apparently some Macs this old have problems with Boot Camp not allowing versions of Windows later than 7. This didn’t affect me (and others have had no issues), but it can be worked around by changing the Boot Camp config file.

From there it should have been like any other Windows 7 machine – use the Windows 10 Media Creation Tool and choose “Upgrade this computer”. (Despite the free upgrade offer having finished years ago, just about everyone finds this still works and the resultant upgrade is fully licenced – assuming the old version of Windows had a proper licence.)

But there was a hiccup. It failed midway through with an error:

0x80070011 – 0x2000D
The installation failed in the SAFE_OS phase with an error during MIGRATE_DATA operation

If you Google around, you’ll find lots of generic advice on forums suggesting to scan your drives, turn off your virus scanner, even try it again in Safe Mode (which doesn’t work – you can’t start an upgrade in Safe Mode).

Only this tip seemed relevant to me:

0x80070011 indicates that the system was trying to move data to another disk drive

0x2000D indicates that there was a problem during the data migration.

It would seem that you have data on another disk drive that the system is trying to migrate and it fails. With your current Win 7 have you moved data about and changed the location of system folders such as programs, users, etc. If so, you should try and get everything back to default locations and try the upgrade again.

Thank you to that person who actually looked into what the error means!

This rang alarm bells for me because some years ago I moved Windows to an SSD (drive C) and put the user directories onto drive D, using SYSPREP so Windows would figure out what was meant to be where.

It seemed like a good idea at the time, but I now realise Microsoft warns this is not supported for Windows upgrades. Damn.

In my case, the SSD is too small to hold all the users’ documents/photos/videos, but should be okay with most other files.

How to fix it

I’ve worked through this (it took several attempts).

Here is my solution, assuming that like me, your user and ProgramData directories are on D: drive and Windows needs to be convinced they’re on C: drive:

  1. If you’re short of disk space, you might want to clean up each user’s D:\users\USERNAME\AppData\Local\Temp directory – eg delete everything older than today.
    (Be warned, this could cause some minor issues with some applications, so if in doubt, don’t delete.)
  2. Disk Cleanup to remove all the unused temp files and empty all the Recycle Bins and free up any other possible space on C:
  3. Copy all the D:\users\USERNAME directories (except the ones that are likely to be big, and can still be located on D: drive: Documents, Pictures, Videos, Music, Downloads) to c:\users
  4. The tricky bit: we need empty Pictures, Videos, Music, Downloads directories, as these don’t get created automatically once the user profile is moved in step 5. I found it was easiest to start copying these one by one, but cancel, then remove all the files in the c: copy, so each was empty – for step 7. We’re using Copy instead of just creating them new to hopefully avoid any permissions problems.
  5. Edit the Registry: Under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList change each user’s ProfileImagePath to the new drive
  6. Log on as each user and check everything looks okay. If it refuses to log you in, you know something’s gone wrong with the C: drive directories or their permissions.
  7. As each user, open Windows Explorer or the Start Menu and browse to My Documents, Pictures, Videos, Music, Downloads, for each of these go into Properties and Move the location back to D:\Users\USERNAME\Whatever. When asked if you want to move files, choose No (since at step 3 you didn’t copy them). (You can do this after upgrading to Win10 if you prefer)
  8. You can then delete the directories you DID copy in step 3 from d:\users\USERNAME – since these are no longer used
  9. Also the ProgramData directory needs to be on C: if it isn’t already. There’s probably no need to copy it back, as applications should re-create what they need. Check and change if required the ProgramData setting in the Registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList to point to C: drive or %SystemDrive%
  10. Verify Win7 is still working okay for each user, then do another Disk Cleanup to clear out the Recycle Bins again. (Clearing old Windows Update files is also possible, but takes ages.)

After all that I found it was okay to go install the Win10 upgrade.

After the upgrade, Public Documents/Pictures/Videos also didn’t show up by default for the users, but these can be added by browsing to the old D:\Users\Public directory and right-clicking each one and choosing Pin To Quick Access.

Other stuff

  • To my surprise, Microsoft Security Essentials wasn’t removed by the Win10 upgrade, at least not the time it worked. The normal MSE uninstall is buggy – you have to jump through some hoops. Running its SETUP.EXE worked for me, but note you have to set the compatibility for ALL users if your normal user it not an Administrator.
  • I briefly tried the claimed method of installing Windows Media Center, which didn’t work for me. I tried Kodi, which needs NextPVR to watch and record broadcast TV… then I discovered that NextPVR can do that on its own – so I removed Kodi again, since I don’t need it!
  • NextPVR did need the LAV decoders, but other than that, it seems to have worked fine with my old EyeTV Diversity USB tuner.

Good luck!

uBank: Sorry, Internet Banking is temporarily unavailable.

uBank is an Australian “Internet bank”, in such that they don’t have any branches. That’s fine, they can do everything except deal with cash. They’re owned by the NAB.

They have an app, which gets an absolute bollocking in the App Store. So people use the website instead. I need to do things with that account about once a month.

Close enough to half the time I try to login, I get the error message “Sorry, Internet Banking is temporarily unavailable.” with a page title of “Login Maintenance”. There’s no other kind of banking with these guys. The last time this happened was just before 4pm, which I believe is the close of transactions for that day. Why the hell would you do site changes in the middle of the day, and why just before the close of business? The NAB is a real bank, and I presume it doesn’t pull this kind of crap. They don’t even give a window (“Out until 14:30” or “Down for five minutes”). No post on their FaceBook website saying “there’s a planned downtime this afternoon” or “Sorry for the emergency outage, but rats were chewing on the coolant lines and that just isn’t okay. We humanely hit them with sticks until they stopped.”.

This is a very bad railroad.