top annoying traps

sklearn is not sklearn If you came across complaint no module named sklearn and you are sure that you “installed” that with pip install sklearn. Sorry, sklearn is scikit-learn instead of sklearn. pip install scikit-learn should solve the problem. Dropbox is syncing all files except some Check if you own the file. It maybe belong…

import module from another folder

A simple hack to import a module from another folder   import sys # caution: path[0] is reserved for script path (or ” in REPL) sys.path.insert(1, ‘/path/to/application/app/folder’) import file    

google passwords

Google passwords failed me again. I got “can’t load this page” error. I didn’t know that password is also saved in chrome. One can retrieve that at setting->autofill

Connnecting slots by name

I tried to use Qt designer, and I don’t see how I can rename a slot in the designer. It turns out that it will try to “connect by the name” directly.  It is quite obscure. And here is a bit of explanation.

gstreamer not working

Somehow using installing ros seems to screw up PKG_CONFIG_PATH and it returns only /opt/ros/noetic/lib/pkgconfig And if I try gst-inspect-1.0 It will return almost nothing. Manage to find the path back with pkg-config –variable pc_path pkg-config So adding export PKG_CONFIG_PATH=`pkg-config –variable pc_path pkg-config`:$PKG_CONFIG_PATH to .bashrc will do the trick. Now gst-launch-1.0 playbin uri=file:///path/to/video will play video…

Mounting EBS volume to AWS ec2

Stop an instance and detach the volume Attach the volume to another instance Mount the volume with commands below     sudo mkdir -m 000 /vol sudo mount /dev/xvdf1 /vol -t ext4  

Bricklink Studio on Wine

Played a little bit of Bricklink Studio. I have to say that it is a very nice app. Unfortunately, it only works natively in Windows and Macs. I tried to use VirtualBox with it. But it is painfully slow. And adding more core doesn’t help. I have an 8-core laptop and adding 4 cores doesn’t…

Ros can’t find package

I was following turtlebot tutorial but it can’t find the package somehow. source ~/catkin_ws/devel/setup.bash does not solve the problem. But it turns out starting fresh by creating a new workspace seems to resolve the problem.    

Use motion for surveillance application.

Motion is great simple software for surveillance application. And it can be easily install in Ubuntu with apt install. It is a command line based software. It doesn’t have some fancy GUI, but the setup is quite easy. The default config file is stored as /etc/motion/motion.conf. One would like to create a .motion directory in…