Friday, January 29, 2021

fix : Unable to update nvidia driver on ubuntu

 sudo software-properties-gtk


1. go to the main tab and remove all selection and select close. ( Let the list update)

2. run the same command, select all options and apply close letting the list update.

3. now you can run the same command go to Additional Driver and install the Nvidia driver.



Problem: ( Ubuintu-16.04, issue with software properties not saved properly)

The following packages have unmet dependencies:
 nvidia-460 : Depends: lib32gcc1 but it is not going to be installed
              Depends: libc6-i386 but it is not going to be installed

Thursday, November 19, 2020

fix : WslRegisterDistribution error 0x80370102

under powershell (run as admin) execute following.


 wsl --set-default-version 1


then run your vm again.


Wednesday, September 16, 2020

fixed sed: preserving permissions for : Permission denied (Windows, MingW)

issue : Windows security settings.

Open the folder's Properties settings from the context menu. In the Security tab, click Edit, press Add... in the pop-up window and add your user to the list, check Full Control in the Allow column. Press OK twice to apply the changes.

Thursday, September 3, 2020

fix / solution : error: No pakage opencv found

sudo apt-get update

sudo apt-get install libopencv-dev


ref: https://www.youtube.com/watch?v=6pABIQl1ZP0

Monday, May 18, 2020

format your code better? In a way that's more readable? the way it looks in an IDE ( copied code form web )


There are multiple solutions

  1. If you have IDE you can copy paste code and can just call format code ( in eclipse short cut is CTRL + SHIFT + F  ,  In Clion or similar ide CTRL + ALT + L, you get the idea )
  2. Other way is to use something called codebutifier.
    1. ex. https://codebeautify.org/cpp-formatter-beautifier
    2. copy your code and Click Format






code template in blogger

When you copy the code to the blogger it gets truncated due to HTML.



The simple solution is to write your code github by clicking the link. ( you may need to create an account if you don't have one, this may change in future)


1. https://gist.github.com/




2. Write the file name ( extension is important  ex. test.cpp)
3. Copy your code as shown

4.  push the "Create public gist"



5. now copy the Embed link and paste in your blog.

6. publish the post and it looks something like bellow.







error: ‘std::vector’ is not a type


int singleNumber( std::vector& nums )


solution:

you have to declare the type.



most of the c++ code that gets copied to html gets truncated and thus this happens. Following can help

https://mihirknows.blogspot.com/2020/05/code-template-in-blogger.html