Skip to main content

Posts

Showing posts from June, 2012

NVIDIA Quadro 10000M (Lenovo W520): Updaing to Kubuntu 12.04LTS from 11.10

Problem when update Kubuntu 11.10 to Kubuntu 12.04LTS on Lenovo W520 When I updated the Kubuntu 11.10 to 12.04LTS, there were some problems I encountered. I can not boot Linux anymore (Black screen with the cursor on top). I can not even boot by the Kubuntu install disk (DVD). There seemed two problems. The install disk problem: it doesn't support NVIDIA Quadro 10000M card. The Linux boot loader's entry address might be changed. Solution Setup BIOS: Graphics card to Integration Graphics (not Discrete card, not Optimus). Then you can boot from the boot DVD disk. Then do the   http://shitohichiumaya.blogspot.de/2012/01/dualboot-with-wde-whole-disk-encryption.html , " Dual boot set up from Windows 7 partition" section. You may want to delete the old boot loading entry, if so, please s ee "Delete the boot entry" below. Install the NVIDIA driver from your package manager. There is 295.40 driver is there. This works for Quadro 10000M. Switch

C++: Operator= returns const reference of *this or reference of *this?

Abstract Recently, I started to use cppcheck. cppcheck suggested me that the return type of operator= should reference of (*this). But I thought this should be const reference of (*this). I thought the reason of this. Contents Cppcheck is an static analysis tool for C/C++ code. (http://cppcheck.sourceforge.net/) I found this tool is quite useful since it sometimes finds a memory leak error and so on. However, the following code has some style error at the operator=. #include class OpTest { public: /// constructor OpTest(int init_int) : m_int(init_int){ // empty } /// operator= with const reference OpTest const & operator=(OpTest const & rhs){ if(this != &rhs){ m_int = rhs.m_int; } return *this; } public: int m_int; }; cppcheck said: [operator_substitute_00.cpp:9]: (style) 'OpTest::operator=' should return 'OpTest &'. I thought when I finished substitution of an instanc