Friday, March 29, 2019

Macbook external monitor display can't show up / disappear when macbook screen lid is closed

There are requirements for the closed-clamshell / closed-lid mode to work, such as:
  • AC power plug-in



more information is here: https://support.apple.com/en-gb/HT201834

Monday, March 25, 2019

[Solved]Macbook display horizontally stretched after display/screen put to sleep

I opened my macbook which was connected to two external screens. They resized mysteriously: horizontally stretched so that the texts were too fat.

I tried using system preference - > displays and switched to other modes but no luck.

The solution turned out to be surprisingly simple (not restarting the computer):

Close the lid of your macbook and reopen it.

Now everything looks fine!


IT support told me that I should restart my computer once per week to prevent this type of things from happening, in the long run.

Thursday, March 21, 2019

[solved] __init__() got an unexpected keyword argument 'height' seaborn

The cause is :
seaborn is outdated
pip3 install seaborn --upgrade

Check whether Jupyter notebook is running or disconnected

cmd + s to save the notebook

When running through a server, I was blindly trusting the [*] and the hour glass. A better way to check whether the notebook is running is cmd + s to save the notebook. If it's still running and should be saved properly. If it's not, an error message would occur.

Tuesday, March 19, 2019

how to set Beeway lock chain password

1 unlock the lock chain
2 rotate the switch to 90 degree
3 set your password
4 rotate the switch back

more details:
https://www.youtube.com/watch?v=wfWpOMY5Sw4

Error: C stack usage is too close to the limit

Change the limit:


https://stackoverflow.com/a/14719448/3020740

Monday, March 18, 2019

[Solved]scp: /home/ubuntu/ Permission denied

When using scp to move files to a server folder, I got errors saying permission denied.
It turned out that the destination folder can't accept files directly.
I moved these files to other folders instead (using the same user credentials)

[Solved] Outlook Sent mail/trash/junk panel is missing

Move your cursor over the left edge of the outlook window, until it becomes a bidirectional arrow.

Move it towards the right, and then the panel will appear, showing inbox/drafts/archive/sent... etc.

Thursday, March 14, 2019

[solved] how to lock screen - Macbook Pro 2018

1.System preferences -> Keyboard -> Customize touch bar
2.expand the touch bar -> Click and drag "Screen lock" onto the touch bar

More information: http://osxdaily.com/2017/02/22/screen-lock-macbook-pro-touch-bar/

[Solved]Matlab Clustergram error: Value must be a 1x2 vector of numeric type in which the second element is larger than the first and may be Inf

I was calling clustergram() and got these errors:

Error using clustergram>computeDendrogram (line 1279)
Encountered error while computing hierarchical clusters:
Value must be a 1x2 vector of numeric type in which the
second element is larger than the first and may be Inf
Error in clustergram/computeClusters (line 909)
        [Z1, H1, ~, perm1] = computeDendrogram(data,...
Error in clustergram (line 413)
        computeClusters(obj);


The cause was: I accidentally gave it a 1Xn vector for clustering
Why I got a 1Xn vector?
Because I was using table2array to concert a variable that was already an array

[solved]ImportError: cannot import name 'neighbors' with Jupyter notebook

import scanpy as sc

/usr/local/lib/python3.6/dist-packages/scanpy/preprocessing/init.py in <module>() 7 from ._combat import combat 8 ----> 9 from ..neighbors import neighbors
ImportError: cannot import name 'neighbors'




I came across that error and found the cause:
I upgraded scanpy while jupyter was still running.

Solution: restart jupyter notebook

Sunday, March 10, 2019

UK nectar sainsbury's: how to register your nectar card online

first try to log in using your nectar card number
After you type in your card number, it will ask you to register. Follow the instructions and finally they will link the new account to your card

Outlook: add a new automatic signature

Open a new email message
Draft -> edit signature -> + -> type your signature text
Choose your default when sending new or replying messages

You can even add pictures in your signature by clicking the image icon.

More details: https://support.office.com/en-us/article/create-and-add-a-signature-to-messages-8ee5d4f4-68fd-464a-a1c1-0e1c80bb27f2

Friday, March 8, 2019

managing python versions using anaconda environments

conda create --name py2.7
conda create -n py2.7 python=2.7
conda activate py2.7

How to shut down a Jupyter Notebook

To shutdown, delete, duplicate, or rename a notebook check the checkbox next to it and an array of controls will appear at the top of the notebook list (as seen below). You can also use the same operations on directories and files when applicable.

Openstack can't mount volume

sudo mkfs.ext4 /dev/vdb
mke2fs 1.44.1 (24-Mar-2018)
The file /dev/vdb does not exist and no size was specified.


Solution:
sudo sed '/^\/dev\/vdb/ d' -i /etc/fstab sudo reboot & ( sleep 30; echo 'b' > /proc/sysrq-trigger )

sudo mkfs.ext4 /dev/vdb sudo mount /dev/vdb /mnt sudo chown -R ubuntu: /mnt cd /mnt && dd if=/dev/zero of=deleteme oflag=direct bs=1M count=1024 && rm deleteme

Friday, March 1, 2019

Macbook: How to forget a network

1.Click on Wifi logo
2.Click "Open Network Preferences..."
3.Click on Wifi tab
4.Click Advanced....
5.Select the wifi you want to forget, click "-"