Posts

Showing posts from 2019

UNICODE MFC CString TCHAR wchar_t and string

1. Convert CString to string stringvar = CT2A(CSTRINGvar); 2. Convert wchar_t * to CString CString tempCString(wchar_tArrayPointer);

How to install Opencv-Python 3.4.7.28 using pip

I tried to import cv2 for my python script but, there is no cv2 module.  After some google search, I found that  "python -m pip install opencv-python" will works for me but, it installs opencv4 not opencv3.  So, I searched google again and found that some conditions for pip command.  $>python -m pip install "opencv-python==3.4"  then I got this message: ERROR: Could not find a version that satisfies the requirement opencv-python==3.4 (from versions: 3.4.2.16, 3.4.2.17, 3.4.3.18, 3.4.4.19, 3.4.5.20, 3.4.6.27, 3.4.7.28, 4.0.0.21, 4.0.1.23, 4.0.1.24, 4.1.0.25, 4.1.1.26) ERROR: No matching distribution found for opencv-python==3.4 So I typed, $>python -m pip install "opencv-python==3.4.7.28" Collecting opencv-python==3.4.7.28   Downloading https://files.pythonhosted.org/packages/db/97/7d04b67cfdc3588c38ed16c92c372a6f682953086b31fd7cefaa9a4a260e/opencv_python-3.4.7.28-cp37-cp37m-win32.whl (26.5MB)      |████████████████████████████████| 26.

WD mycloud Gen2 hard drive replacement and initialization

1. Get linux bootable image like https://sourceforge.net/projects/systemrescuecd/files/sysresccd-x86/3.8.1/systemrescuecd-x86-3.8.1.iso/download 2. Rufus portable for linux image writing for usb drive. https://rufus.ie/ 3. Download uImage and uRamdisk files and copy them to USB drive. https://drive.google.com/drive/folders/0B_6OlQ_H0PxVRXllYjY5RG1CZEU 1) Developing/uImage-wdrecovery 2) Developing/uRamdisk-wdrecovery 4. Plug in USB drive and turn on PC with pressing boot select mode button. 5. Select GUI mode. 6. To make initialize hard drive, run gparted. 7. Delete all partition of hard drive (Be aware of right device path /mnt/sda or /mnt/sdb or /mnt/sdc i.e. my case was /mnt/sdb ) 8. Go back to terminal, then type follows: > parted /dev/sdb parted> mklabel gpt parted> mkpart primary 1049kB 2149MB parted> mkpart primary 8591MB -1MB parted> mkpart primary 7517MB 8591MB parted> mkpart primary 2149MB 3222MB parted> mkpart primary 3222MB 4296

OpenCV UWP considerations

I got OpenCV example article in UWP like this. https://docs.microsoft.com/ko-kr/windows/uwp/audio-video-camera/process-software-bitmaps-with-opencv

When fscanf(fp,"%f,",&fval); is not working

When read text file like filter constant file, I usually use fscanf(fp, "%f", &fval);. But Today, it is not working at all. So, I spent whole 5 hrs then found that text file is encoded UTF-8. So, I save as ASCII text file then it works like a charm.

Dell latitude E5550 WWAN installation Sierra

Image
I got Dell latitude laptop E5550 that has USIM port without WWAN card. So I purchased WWAN card (   DW5809e   / EM7305) from aliexpress at 30.15USD. I installed it and windows 10 driver installed automatically. Then I found that Cellular option is activated. So, I unscrewed back cover and installed USIM card (micro not nano USIM). I reboot laptop 3 times to attach LTE. Then it works with SK telecom LTE seamlessly. I am happy now. Enjoy.

How to arrange , separated text (add every 24th comma to \n)

Image
1. I got RGB color map value (256*3) = 768 values as below: colorarray07[256*3] = { 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, ... } 2. I would like to arrange like this: colorarray07[256*3] = {     0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255,     ...     } 3. Using VSCODE, I copied value section to vscode. 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, 0,0,255, ... 4. Replace all using following condition with regex on (to make one line text) ,\n  to , 5. Replace all using following condition with regex as follows: ([0-9]+\,){24} to $0\n 6. It works like charm.

How to set time on Xiaomi AI Alarm clock / 샤오미 인공지능 알람시계 시간설정

Image
1. Get iOS device and install Mi Home App. 2. Delete registered device in MiHome app (either Android / iOS) 3. Reset Xiaomi AI Alarm clock by pressing reset hole using pin for 4-7 seconds until you hear some Chinese announcement . 4. Open iOS time setting(Settings - General - Date & Time) 5. Deselect automatic time and change timezone to where you would like to set. 6. Open Mi Home and Find Xiaomi AI Alarm clock then check resetting button. Select Wifi AP information then. 7. Ta~da, Time will be changed as you would like to use. ---- 1. 아이폰이나 아이패드등 iOS디바이스를 구합니다. 2. 기존에 앱에 등록되어 있으면, 디바이스를 삭제해줍니다 3. 샤오미 AI 알람시계 밑에 있는 reset 구멍에 핀을 이용하여 오래 꾸욱 누르면 중국말로 뭐라고 나오면 리셋된겁니다. 4. iOS디바이스에서 설정-일반-날자시간설정 을 엽니다. 5. 자동으로 설정을 끄시고 시간대를 서울 또는 도쿄로 바꿉니다. 6. Mi Home을 열고 추가(+) 메뉴로 디바이스를 등록하고 Reset을 진행한 후에 Wifi 접속정보를 입력하면 7. 짜~잔 하고 접속정보 보낼 쯤에 시간이 바뀌는걸 확인하실 수 있습니다.