memoryfolder

メモです

how to use a specific pull request of a python library

I want to use qutip's pull request #815. Recently I git checkout this as explained in
how to checkout to a specific pull request - memoryfolder

Now I'd like to actually use this. First, I need to uninstall the module

C:\>conda uninstall qutip
...

Then,

C:\>cd code/qutip

C:\code\qutip>python setup.py install
...

I'm ready to use it!

Returning Macbook Pro bought at apple store

Apple has very flexible return policy.
I bought MacBook Pro 2018 with 512GB storage, but thought I'd want 16 gigs of RAM instead of default 8. I returned and got full refund, no questions asked.

The beats solo 3, that came for free with the mac, was without the box, they just took it as it is and did full refund.
It may depend on the condition and not applicable to all cases, but until 14 days after purchase you can expect full refund.

One point to note is, if you buy from apple stores you have to return to one of their stores, whereas if you buy from apple.com you can either ship it or bring to stores.
I should have bought online (I had to go to reading just for this..)

一時帰国持ち物リスト

年に4-5回日本に帰ってます。必要な持ち物たまに忘れてつらいのでメモ

  1. Mac電源アダプタの、コンセント部分(ヨーロッパ版と日本版両方)
  2. ゼムクリップ1個財布とかに入れとく(Sim入れ替えるため)
  3. 使い捨て歯ブラシ
  4. マスクとトローチ
  5. 頭痛薬とベンザブロック
  6. to be added

Boseノイズキャンセリングヘッドホンほしい。


Todo

  1. Registered traveller登録して空港で列に並ばなくてもいいようにする - done!

Registered Traveller: faster entry through the UK border - GOV.UK

bloch sphere drawing

bored from talks.

import numpy as np
from qutip import *

if __name__ = '__main__':

	dist2d = np.random.normal(scale=0.1,size=(2,500))
	plt.hist(dist2d[1,:])

	b = Bloch()
	# T
	theta = np.pi/4 + dist2d[1,:]/10
	phi = np.pi*0 + dist2d[0,:]*2
	x = np.sin(theta)*np.cos(phi)
	y = np.sin(theta)*np.sin(phi)
	z = np.cos(theta)
	theta = np.pi/3 + dist2d[1,:]
	phi = np.pi*0 + dist2d[0,:]/10
	x = np.concatenate((x,np.sin(theta)*np.cos(phi)))
	y = np.concatenate((y,np.sin(theta)*np.sin(phi)))
	z = np.concatenate((z,np.cos(theta)))

	# e
	theta = np.pi*0.36 + 0.2*np.cos(dist2d[1,:]*2.5*np.pi-np.pi/2)
	phi = np.pi*0.15 + 0.2*np.sin(dist2d[1,:]*2.5*np.pi-np.pi/2)
	x = np.concatenate((x,np.sin(theta)*np.cos(phi)))
	y = np.concatenate((y,np.sin(theta)*np.sin(phi)))
	z = np.concatenate((z,np.cos(theta)))
	theta = np.pi*0.35 + dist2d[1,:]/10
	phi = np.pi*0.15 + dist2d[0,:]
	x = np.concatenate((x,np.sin(theta)*np.cos(phi)))
	y = np.concatenate((y,np.sin(theta)*np.sin(phi)))
	z = np.concatenate((z,np.cos(theta)))

	#a
	theta = np.pi*0.36 + 0.2*np.cos(dist2d[1,:]*2.5*np.pi-np.pi/3)
	phi = np.pi*0.3 + 0.2*np.sin(dist2d[1,:]*2.5*np.pi-np.pi/3)
	x = np.concatenate((x,np.sin(theta)*np.cos(phi)))
	y = np.concatenate((y,np.sin(theta)*np.sin(phi)))
	z = np.concatenate((z,np.cos(theta)))
	theta = np.pi*0.36 + dist2d[1,:]*0.9
	phi = np.pi*0.34 + dist2d[1,:]*0.4+dist2d[0,:]*0.2
	x = np.concatenate((x,np.sin(theta)*np.cos(phi)))
	y = np.concatenate((y,np.sin(theta)*np.sin(phi)))
	z = np.concatenate((z,np.cos(theta)))

	# m
	theta = np.pi*0.36 + dist2d[1,:]*0.8
	phi = np.pi*0.4 + dist2d[0,:]*0.1
	x = np.concatenate((x,np.sin(theta)*np.cos(phi)))
	y = np.concatenate((y,np.sin(theta)*np.sin(phi)))
	z = np.concatenate((z,np.cos(theta)))
	theta = np.pi*0.32 + 0.06*np.cos(dist2d[1,:]*2.*np.pi-np.pi)
	phi = np.pi*0.43 + 0.06*np.sin(dist2d[1,:]*2.*np.pi-np.pi)
	x = np.concatenate((x,np.sin(theta)*np.cos(phi)))
	y = np.concatenate((y,np.sin(theta)*np.sin(phi)))
	z = np.concatenate((z,np.cos(theta)))
	theta = np.pi*0.36 + dist2d[1,:]*0.8
	phi = np.pi*0.45 + dist2d[0,:]*0.1
	x = np.concatenate((x,np.sin(theta)*np.cos(phi)))
	y = np.concatenate((y,np.sin(theta)*np.sin(phi)))
	z = np.concatenate((z,np.cos(theta)))
	theta = np.pi*0.32 + 0.06*np.cos(dist2d[1,:]*2.*np.pi-np.pi)
	phi = np.pi*0.47 + 0.06*np.sin(dist2d[1,:]*2.*np.pi-np.pi)
	x = np.concatenate((x,np.sin(theta)*np.cos(phi)))
	y = np.concatenate((y,np.sin(theta)*np.sin(phi)))
	z = np.concatenate((z,np.cos(theta)))
	theta = np.pi*0.36 + dist2d[1,:]*0.8
	phi = np.pi*0.49 + dist2d[0,:]*0.1
	x = np.concatenate((x,np.sin(theta)*np.cos(phi)))
	y = np.concatenate((y,np.sin(theta)*np.sin(phi)))
	z = np.concatenate((z,np.cos(theta)))

	vec = [x,y,z]
	b.add_points(vec)
	b.point_size = [1,1,1,1]
	b.point_color = ['r']
	b.show()

f:id:sunakku:20181006195128p:plain

仮想通貨マイニング現状

さすがに今から始める人はいないと思いますが… 普通に損するみたいですね笑
Radeon R9 290x Tri-X ETH 22 MH/s Overview and Profitability Calculation | CryptoCompare.comwww.cryptocompare.com

1月に全部売っ払っといてよかった。仮想通貨売却益だけじゃなくGPU売るのでもプラスになりました(買値より高く売れた)。寮に住んでて電気代もタダだったし、いい時代でした。他のことがちょっとしんどかったけど。

Kaggle API config

すごい簡単です。まずはpip install

C:\code\kaggle>pip install kaggle
...
Successfully installed kaggle

C:\code\kaggle>kaggle
Traceback (most recent call last):
...
ValueError: Error: Missing username in configuration.

Configが必要です。Kaggleのアカウントページに行って(右上の変なアイコンをクリックして”My account”をクリック)、真ん中のあたりにAPIのセクションがあるので、”Create API Token”を押してKaggle.jsonをダウンロードします。これをUses/(username)/.kaggle/に移せば

C:\code\kaggle>kaggle competitions list
ref                                            deadline             category            reward  teamCount  userHasEntered
---------------------------------------------  -------------------  ---------------  ---------  ---------  --------------
digit-recognizer                               2030-01-01 00:00:00  Getting Started  Knowledge       2564           False
titanic                                        2030-01-01 00:00:00  Getting Started  Knowledge       9728           False
house-prices-advanced-regression-techniques    2030-01-01 00:00:00  Getting Started  Knowledge       4073           False
imagenet-object-localization-challenge         2029-12-31 07:00:00  Research         Knowledge         26           False
pubg-finish-placement-prediction               2019-01-30 23:59:00  Playground            Swag         29           False
human-protein-atlas-image-classification       2019-01-10 23:59:00  Featured           $37,000         51           False
two-sigma-financial-news                       2019-01-08 23:59:00  Featured          $100,000        507           False
competitive-data-science-predict-future-sales  2019-01-01 23:59:00  Playground           Kudos       1521           False
PLAsTiCC-2018                                  2018-12-17 23:59:00  Featured           $25,000        131           False
quickdraw-doodle-recognition                   2018-12-04 23:59:00  Featured           $25,000        176           False
ga-customer-revenue-prediction                 2018-11-15 23:59:00  Featured           $45,000       1965           False
airbus-ship-detection                          2018-11-14 23:59:00  Featured           $60,000        951           False
inclusive-images-challenge                     2018-11-05 23:59:00  Research           $25,000        327           False
rsna-pneumonia-detection-challenge             2018-10-24 23:59:00  Featured           $30,000       1140           False
tgs-salt-identification-challenge              2018-10-19 23:59:00  Featured          $100,000       3025           False
new-york-city-taxi-fare-prediction             2018-09-25 23:59:00  Playground       Knowledge       1488           False
forest-cover-type-kernels-only                 2018-09-24 23:59:00  Playground       Knowledge        359           False
demand-forecasting-kernels-only                2018-09-24 23:59:00  Playground       Knowledge        462           False
whats-cooking-kernels-only                     2018-09-24 23:59:00  Playground       Knowledge        523           False
flavours-of-physics-kernels-only               2018-09-24 23:59:00  Playground       Knowledge         64           False

これでOK!

ここに全部のってます