Month: March 2015

the Naked Portalfilter

Posted by – March 29, 2015

My bottomless portafilter ordered from www.naked-portafilter.com has finally arrived home this morning from Hungary! Over the last a few weeks, I have been trying to figure out the problems why I am not able to produce rich crema of my espresso. Now  I hope this is the tool for me to find out the problems, whether is dose or channeling or something else! At the moment, I suspect that uneven tamping which results in uneven extraction could have attributed to the lack of crema. But let’s see what I can observe from this tool.

I am all agog to see my perfect extraction with it! Please stay tuned with my extraction video.

 

IMG_0951

 

This Hungarian company www.naked-portafilter.com is quite an interesting one, of which the website featured a quite professional video promoting their bottomless portafilter. The video is somewhat reminiscent of Apple’s promotion videos for their Macbook. Take a look the video below see whether if you find it interesting.

 

 

(You can’t see this video from China, as Youtube is blocked in mainland China)

Fake pass-code from Ubuntu Bluetooth GUI

Posted by – March 27, 2015

Today, I bought a Bluetooth 4.0 dongle to connect my Logitech K760 keyboard. But I could not get it working with my Ubuntu system. Initially, I thought the Bluetooth adaptor does not support Ubuntu, as the product description says it only supports Windows… But lsusb shows the below output, which to me does not look like an OS issue.

xinquan@:~$ lsusb 
Bus 002 Device 003: ID 03f0:0324 Hewlett-Packard SK-2885 keyboard
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 007: ID 0b95:772a ASIX Electronics Corp. AX88772A Fast Ethernet
Bus 001 Device 006: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

After attempting to connect via the Bluetooth GUI, it gave me a passcode to type in on my wireless keyboard, which I proceed to do. It immediately gave me this error: ‘Logitech K760 failed to connect’.

 

After some googling, it turns out that the passcode from the Bluetooth GUI was bogus, the correct passcode can be obtained from the command tool hcidump! Goshi… After I typed the passcode from hcidump, it connected successfully!

sudo apt-get install bluez-hcidump
sudo hcidump -at | grep -A 1 "User Passkey"

2015-03-27 11:29:29.787512 > HCI Event: User Passkey Notification (0x3b) plen 10
    bdaddr 00:1F:20:3E:53:A2 passkey 359872

Double quotes in SQL

Posted by – March 23, 2015

For an hour or so, I have been debugging an SQL error thrown by the PostgresSQL in my CakePHP application. The error message was also not really helpful. Below is the SQL generated by the CakePHP update function

UPDATE "public"."posts" SET "value" = asap WHERE id = (1) 


SQLSTATE[42703]:
Undefined column: 7 ERROR: column "asap" does not exist LINE 1:

The culprit turns out to be that how quote is used to identify a string in SQL.
I have to explicitly put the single quote in the string value ‘asap’ in the CakePHP function below when updating a record of the Model Post.

The below is the signature of the updateAll function from CakePHP library.

public function updateAll($fields, $conditions);

The tricky part is you can’t quote strings in the conditions, but for the updating value of the fields, the string has to be single quoted.


     $this->Post->updateAll(
       array('Post.value' =>  "'asap'" ),
       array('Post.key = ' => "when"));

A further discussion can be seen at the stackoverflow page
http://stackoverflow.com/questions/1992314/what-is-the-difference-between-single-and-double-quotes-in-sql

Cigarettes in Chinese wedding

Posted by – March 8, 2015

If you ask westerners, who have been to Chinese weddings, about their experiences, the feedbacks will probably be something like this

The wedding was great, except for the smoking!

Yet, smoking in a Chinese wedding in mainland China is still ubiquitous. Traditionally, although not sure from when, the bride is supposed to light up cigarettes for the elder guests and the groom makes the toast when they greet the guests. This cultural mores may be great for the smokers but can be horror experiences for non-smokers like me.

What’s more is that the children and women who do not smoke are not aware the harm of secondhand smoke in China, or they are inure to this environment,  like the heavily polluted air.

Over the last a few weeks, I have tried very hard to push and convince my parents to put off the cigarettes at my wedding reception in China, and I have encountered numerous obstacles.

“The guests will think you are penny-pinching”, “ungenerous”, one of my friends advised.

“Do in Rome as Rome does (入乡随俗)”, Another one of my relatives suggested.

However, it is my belief that this kind of social mores in China are not necessary to be followed. One day, hopefully, not far from now, people will recognise that tobacco is harmful and should not be part of social occasions and gift-giving.

An image from Shanghai government website