Posts

wxFormBuilder setup on ubuntu

Pre-requisites for Ubuntu: #sudo apt install libwxgtk3.0-dev libwxgtk-media3.0-dev meson sudo apt-get install libwxgtk3.0-dev libwxgtk-media3.0-dev libboost-dev Download and build: git clone https://github.com/wxFormBuilder/wxFormBuilder cd wxFormBuilder ./create_build_files4.sh cd build/3.0/gmake make config=release sudo apt-get install libcanberra-gtk* Run: cd ../../../output/bin/ ./wxformbuilder Qtpy setup pip3 install --user pyqt5 sudo apt-get install python3-pyqt5 sudo apt-get install pyqt5-dev-tools sudo apt-get install qttools5-dev-tools

python snippet

Creating pr function instead of print yoo = 7 def names (thing): return [name for name , ref in globals ().items() if ref is thing][ 0 ] # print(names(yoo)) def pr (varname): print (names(varname)+ ": " , varname) pr(yoo)

Adding terminal title

Open bashrc gedit ~/.bashrc Add below line in end of the file function set-title() { if [[ -z "$ORIG" ]]; then ORIG=$PS1 fi TITLE="\[\e]2;$*\a\]" PS1=${ORIG}${TITLE} } put command source ~/.bashrc Done now you can add title in terminal tab set-title Hello

Creating blocks in gist.github to show on bl.ock.org

1. Create an account, if required, at https://gist.github.com/. 2. Go to your personal page eg https://gist.github.com/krajiv26. 3. Click New gist. Type in gist description. 4. We cant create here any folder so create .block to attach files in future.  Type in gist description 5. Also add Content for .block file which will be shown on bl.ock.org boxes list 6. Now click on Create Public gist. This will create a public gist. 7. Start editing just crated .block  8. Add files by "Add" below and must create index.html file and save 9. Go bl.ock.org to see your block

Creating OpenCv Logo with OpenCv

Image
OpenCV logo ¶ In [177]: from matplotlib import pyplot as plt % matplotlib inline In [178]: import cv2 In [179]: # Load an color image in grayscale ocvimg = cv2 . imread ( 'opencv-logo-white.png' , 1 ) plt . imshow ( ocvimg ) plt . xticks ([]), plt . yticks ([]) # to hide tick values on X and Y axis plt . show () In [180]: import numpy as np # Create a black image img = np . zeros (( 512 , 522 , 3 ), np . uint8 ) In [181]: img = cv2 . ellipse ( img ,( 256 , 100 ),( 98 , 98 ), 60 , 60 , 360 , 255 , - 1 ) plt . imshow ( img ) plt . xticks ([]), plt . yticks ([]) # to hide tick values on X and Y axis plt . show () In [182]:

Creating new virtual env in Python3 core

First install virtualenv package pip3 install virtualenv Now you can create new environment lets flaskblog python3 -m virtualenv flaskblog Now Source it source flaskblog/bin/activate Use below command to quit environment deactivate You can alway check environment with  which python3

Adding Intellij Idea link in Application Launcher in Lubuntu

cd /usr/share/applications sudo nano intelij-idea.desktop Write the content as  #!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Name=Intelij Comment=Intelij Idea Exec=/home/rajiv/ideaIC-2018.2.2/idea-IC-182.4129.33/bin/idea.sh Terminal=false Type=Application Categories=Development; Icon=/home/rajiv/ideaIC-2018.2.2/idea-IC-182.4129.33/bin/idea.png save and close this file Now you can see Intelij under Programming menu.