Nihao Tianmao

There are lots of smart speakers on the market. In China, the ones offered by TMall are quite popular and during a recent trip to Shanghai, our family got one as a gift from a relative. I had a look and at that time this model sold for RMB 89, approximately £10 / €11 / $12.

tianmao-1

According to the box it supports Bluetooth and is dts ‘certified’. I am not sure whether that means that the speaker has to fulfil certain minimum requirements regarding sound quality or whether it just means that it can play certain sound formats.

The speaker itself is very small and, considering it’s small size and low price, it sounds great.

tianmao-2

There are however a few drawbacks if you want to use this speaker, even if it’s only as a Bluetooth speaker.

  • It (currently) only understand Mandarin – no other Chinese dialects and no other languages.
  • You need to install the TMall app on your phone to install it, you then need a TMall account, too. They do want you to be bound to their eco-system.
  • You need to ask the speaker to pair with a Bluetooth device in Mandarin. There’s currently no button combination that lets you go into pairing mode.

I set up a guest network in my Wifi router. I wasn’t too keen on Tianmao (‘Sky Cat’) seeing my other network devices.

Advertisements

Auto-Hi

After updating my GR II’s firmware I noticed that the Auto-Hi ISO setting didn’t work anymore as expected. I try to keep the shutter speed at least at 1/60 sec – but after the update it went as low as 1/40 sec for some shots. The manual didn’t provide any explanation in the Auto-Hi section, but it turns out that after the update Dynamic Range Compensation was on Auto, which means that the Auto-Hi setting gets ignored and the Auto ISO setting gets used instead.

Dynamic Range Compensation
Dynamic Range Compensation (p.51)

This is in the manual, but not being mentioned under Auto-Hi. Normally you wouldn’t think of looking in the Dynamic Range Compensation if you have an issue with the Auto-Hi ISO setting, so I thought I spell out what is going on, somebody else might benefit from this information. I certainly have turned Dynamic Range Compensation off.

Ricoh GR II
Ricoh GR II

 

Rico GR II vs. Leica X1 – a subjective comparison

The Leica X1 came out in 2008. I bought a used one in 2012, when the second hand price became affordable and have loved this camera ever since. My main issue with the X1 is that the autofocus is very slow.

The size of the camera is great, which is the reason I often use it instead of my SLR.

L1014375
Leica X1

Now in 2018 I still use the X1, but the main issues are worst under the circumstances I need the camera most: when taking photos indoors with small kids, e.g. at family gatherings.

I now got a Ricoh GR II (new, but for a good price) in the hope it will fix some of the issues I have with the X1 (if it is better for my purposes I will sell the X1).

L1014373
Leica X1

Sensor

Both have APS-C sized sensors. Nice. Megapixel count is not much of an issue for me (12 vs 16 MP).

Low Light Performance

I expected much better low light performance with the GR II. When shooting raw and using Lightroom to me there’s not much of a difference between the GR II and the X1. Why Lightroom? I get Lightroom for free through my employer’s education licence and to me raw photos in Adobe’s Lightroom look much better than in Apple’s Photos. The GR II can go higher in terms of ISO, but I haven’t really done enough above ISO 3200 to have a valid opinion. If I didn’t have access to Lightroom I might have a different opinion. I guess the reason I don’t see much of a difference is because of all the clever stuff Lightroom does with the raw files.

R0000345
Ricoh GR II

Handling

The GR II is easy to handle with one hand – taking it out of the ‘belt case’, turning it on, taking a photo. Turning it on is much faster and most importantly the autofocus is much faster. The screen of the GR II is also much better, nice, but I don’t care about it that much.

Some things are much easier to set on the X1, e.g. shutter speed, aperture, but for me the short time it takes from ‘camera in the case’ to ‘taking a photo’ is so much better with the GR II that it outweighs all other disadvantages the GR II has. I especially like the setting where I can determine at which shutter speed the ISO value should change. I currently have it set to 1/60s, but might go higher. I think trading high ISO noise for less motion blur might be worth it.

The level display (a kind of electronic spirit level) is a really nice feature. I don’t really use the one in my SLR, so didn’t expect to like or even think about the GR II’s level display but have come to really like it in the few days I used the GR II.

R0000321
Ricoh GR II

 

Lens and Choice of Camera

The GR II has a 28mm equivalent lens, whereas the X1 has a 35mm equivalent lens. I very much prefer 35mm, but there isn’t much available in that size. Cameras like the Fujifilm X100 are much bigger than the X1 / GR II, so are out of the race. The Sigma DP2 is similar in size to the X1, but as far as I can tell not better than the X1, at least not for my purposes. A used Leica’s X2 is unfortunately (still) too expensive for my budget. I could have gone for the X70, but explaining why I ended up with the GR II would distract from the point of this blog post.

R0000335
Ricoh GR II

 

PHP display_errors for Dreamhost

DreamHost has recently disabled all PHP warnings by default.

I guess that’s a good idea in a production environment, but I’ve been using Dreamhost for teaching PHP since we left our previous web hosting provider MyServerWorld in 2010.

I’m not sure why Dreamhost decided to change error handling recently, but now my students don’t know where the mistakes in their code are. The fact that this happened just before the main assignment wasn’t great timing.

Dreamhost’s Knowledge Base only shows how to turn on logging into a file, not how to display the error message as before. The following instructions are useful for my BT2201 and BT3023 students, but maybe also for other Dreamhost users.

Turning on display_errors

To see the error message, rather than a generic ‘500 internal server error’ we can change the php.ini file (called phprc on Dreamhost).

  • Every account should see a ‘.php’ folder when logged in via (S)FTP.
  • In that folder, there will be different folders for the different versions of php offered. Currently, that’s everything from 5.3 to 7.2. I assume they are all there because an account can have more than one domain and different domains can be set to run on different versions of php.
  • Add the following line to the top of the phprc file:
display_errors = On

 

If it didn’t work within a few minutes…

The new settings should come into effect within a few minutes, but if they don’t you can do the following.

To kill off running PHP processes you need to log in via SSH (which my students can’t do) and run

killall -9 php70.cgi

or the appropriate command for the php version used (e.g. php56.cgi instead of php70.cgi).

Alternatively, you can open the ‘Manage Domains’ settings page on Dreamhost’s web interface (something my students can’t do either) and just resave your settings.

Word Count in a TermDocumentMatrix

When using Ingo Feinerer’s tm package to have a closer look at some text, I tried to get the word count from a DocumentTermMatrix using

text_dtm <- DocumentTermMatrix(text_corpus) 
rowSums(as.matrix(text_dtm))

The Problem

For many rows the word count seemed to be too low. This entry, for example, has 13 words.

pencilrevolution$content[635] 
##[1] "    Off to the National Portrait Gallery today with my oldest child. We're prepared. " [/sourcecode]

tm’s rowSum only showed 11.

 rowSums(as.matrix(pr_dtm))[635] 
##635 
## 11

A quick look at the row showed this.

which(pr_m[635,]>0)

##   child.   gallery  national       off    oldest  portrait prepared.       the     today   we're      with 
##     4699      8809     13127     13656     13729     15069     15235     19311     19691     20969     21334

☞ The two two-letter words to and my were missing.

?DocumentTermMatrix

mentions that local options are documented in termFreq.

?termFreq

shows the control option wordLengths, which defaults to c(3, Inf), i.e., a minimum word length of 3 characters.

The Solution

Changing wordLengths to 1 solved the problem.

#pr_dtm <- DocumentTermMatrix(pr_corpus)
pr_dtm <- DocumentTermMatrix(pr_corpus, control=list(wordLengths=c(1, Inf)))

 


Excuse the line breaks in the code. R Syntax Highlighting didn’t work as explained in the previous blog post.

R Syntax highlighting problems on wordpress.com?

I recently tried to use R Syntax highlighting on this wordpress.com blog, as shown in Tal Galili’s blog post.

Unfortunately it didn’t seem to work well (and I lost quite a bit of work as a result). When I used too many blocks of R source code things got messy and code in my blog post would get lost/modified. When trying to redo the lost part of the blog post this happened again, so it wasn’t a one off.

Span tags would appear in the code and would then stay in my editor. r-highlighting-error
I assume there is a workaround as R Syntax highlighting in wordpress.com has been around for many years, but for now I’ll stick to pasting code as preformatted text.

The whole thing wasn’t helped by the fact that wordpress.com doesn’t store the history of your blog post edits, at least not until you have scheduled a blog post. a normal wordpress installation on your own web space gives you access to previous drafts.

Installing FreeNAS on a HP Microserver

Another post about my installation experience, mainly so that I can look up what issues I came across if I have to do this again. This is on my HP Gen8 Microserver (by now Gen10 is already out).

My old NAS4Free system couldn’t be updated, at least not without getting the server out of the inaccessible corner where it has served away for the last few years.

Handling snapshots was not easy, so I wanted to update, but thought if the server is out anyway I might as well give FreeNAS a chance. I don’t remember why I decided NAS4FREE is better for my purposes when I installed the server originally and I this time round I didn’t spend much time comparing both systems, so might have picked the less optimal system for my purposes.

FreeNAS or NAS4Free

Followed instructions from http://doc.freenas.org/11/install.html

Had to use sudo to get the iso to the USB stick. Copying took around 2 minutes.

Didn’t work first time round, despite following instructions. Tried again, this time with ejecting the disk  in terminal

diskutil eject /dev/disk6

after dd command. Still no joy.

Tried adding the USB stick after graphical boot screen as described in this forum.

Still doesn’t work.

Tried to boot NAS4FREE from USB stick, also didn’t work.

Tried another computer (maybe computer crazy, virus scanner, …)

Didn’t work from second Mac either

Trying to write iso with Rufus on Windows machine. Writing with windows app recommended in FreeNASdoc outdated (Windows 7). Rufus: Works.

Q: Why does writing the iso not work with new versions of Apple’s disk utility, used to work with old one

FreeNAS doesn’t seem to be able to install FreeNAS either because it was the USB stick the machine booted from or because 8GB is too small. Installing on other USB. Worked.

To my surprise FreeNAS was able to import my old ZFS Volumes/Pool and I even had access to all Snapshots!

Deleting old snapshots is much easier than in my outdated version of NAS4Free, e.g. to save space I only keep snapshots form the first of a month, so I can filter all snapshots where the name does not contain 01- (as in auto-20150901-000000).

Setting up rsync

Created user (Account / Add User) (wheel group)

Configured rsync as described at http://doc.freenas.org/11/tasks.html#rsync-module-mode

Configured Hyperbackup in Synology NAS

HDD standby

Set up  HDD standby:

Storage / View Disks / HDD name / edit

time is in minutes

Services / SMART / Power Mode / Standby (check the drive unless it is in SLEEP or STANDBY mode)