Skip to main content

Posts

Showing posts from January, 2012

Using NVIDIA Quadro 10000M (Lenovo W520) with Kubuntu 11.10

Unfortunately, NVIDIA Quadro 10000M doesn't work on Lenovo W520 with Kubuntu 11.10 from the out of box. Here is how I set up. We need to do three things: pci=noacpi  in the kernel option (see the my last blog section 5 boot set up.) If you have still problem try acpi=off , but in this case I have only one CPU core detected. See  https://wiki.ubuntu.com/DebuggingACPI Set graphics device to discrete graphics since Nvidia Linux driver seems have not yet Optimus support. Update the Nvidia driver to 290.10. (280.13 seems not work on this machine. The error is:  udev-fallback-graphics main process ($PID) terminated with status 1) I assume you are still in Optimus or Integrated chip mode. In this mode, you can have X running, so it is a good start. I first updated the Linux kernel to 3.0.0.15. There are two ways: Ubuntu way and direct installation.  Ubuntu-way should be later better, but in my case, glxinfo does not work.  And the fowllowing error I got. % glxinfo na

Dualboot with WDE (Whole Disk Encryption) Windows 7 and Linux Kubuntu 11.10

See the great reference http://www.iceflatline.com/2009/09/how-to-dual-boot-Windows-7-and-linux-using-bcdedit/ Introduction I have PGP-WDE on a Windows 7 laptop, but I want to have a Linux dual boot partition and also with whole disk encryption. This is how it was done. Detailed situation Usually, A virtual machine is convenient. Home directory encryption is enough. Just use PGP-WDE is possible. But, sometimes life is not so easy. If you are in the following situation, you have the same problem with me. Performance oriented multi-platform development. New low level programming (e.g., CUDA 4.0) The company policy needs Whole Disk Encryption. And PGP-WDE has not yet supported on new kernel of Linux and MacOS. At 2012-1-25(Wed), No Ubuntu 11.x support and no MacOSX Lion support yet.  http://www.symantec.com/products/sysreq.jsp?pcid=pcat_info_risk_comp&pvid=wd_encryption_1 Then, we need another solution. Suggested solution Windows 7 partition is encrypted by PG

Passing a user defined python object to C++ code(4)

How to access to self.face_idx_list . extracting a numpy.int64 type failed. The difference between this article and the last one is numpy.array contains numpy.int64 instead of numpy.float64. We can access numpy.float64 value as the following: vec[i] = boost::python::extract< float >(     float32_3_obj.attr("__getitem__")(i)); I.e., we can convert numpy.float64 value to float value by boost::python::extract< float >(f) . However, when we try to convert numpy.int64 to int as the following code, it fails. vec[i] = boost::python::extract< int >(     int32_3_obj.attr("__getitem__")(i)); We can not convert numpy.int64 by boost::python::extract< int >(i) . We will get the following error: TypeError: No registered converter was able to produce a C++ rvalue of type int from this Python object of type numpy.int64. That's strange. float is OK, but int isn't.  I looked up the web, there are some articles regarding with this issu

Passing a user defined python object to C++ code(3)

How to access to the self.vertex_list. This time I will explain how to access to the self.vertex_list of TriMesh. This is a list of length three numpy.array. We have already seen how to get the python list (dict's keylist) in my former article http://shitohichiumaya.blogspot.com/2010/08/boostpython-how-to-pass-python-object.html . How to access to the float numpy.array element is the following. void print_float32_3(boost::python::object const & float32_3_obj) {     // check sequence length is 3 or not.     if(boost::python::len(float32_3_obj) != 3){         std::string const objstr =             boost::python::extract< std::string >(                 boost::python::str(float32_3_obj));         std::cerr << "print_float32_3: arg is not a float[3] obj ["                   << objstr << "]" << std::endl;         return;     }     float vec[] = {0.0f, 0.0f, 0.0f};     for(int i = 0; i < 3; ++i){         vec[i]

Passing a user defined python object to C++ code(2)

The python code of the last article contains a simple triangle mesh (TriMesh) and sets some data to the object. The mesh has only two triangles that forms a rectangle. It's not so exciting scene, but it is sufficient as an example. The scene is shown in the following image. A camera looks up the rectangle. Figure 1. TriMesh scene example (one rectangle) This article explains how to access to the three members of TriMesh. Each member of a python object is an attribute, there is a way to access to any attribute in general, but I think it is complicated. I assume the programmer has an knowledge about a specific python class. For example, I know TriMesh object has three member variables (three attributes). self.__material_name : a string, but this is a private member. We should access to this member via get_material_name() method. self.vertex_list:  A list of numpy.array, that contains length three numpy.float64. self.face_idx_list : A list of numpy.array, that contains l

Passing a user defined python object to C++ code(1) Source code

Once I explained how to pass a python build-in object (dict, list, and string) to C++ code using python.boost. http://shitohichiumaya.blogspot.com/2010/08/boostpython-how-to-pass-python-object.html This time, I will explain about how to pass a user defined python object to C++ via python.boost. I will also explain why numpy.array's numpy.int64 object casts an error when I do extract< int >. This casts a TypeError (TypeError: No registered converter was able to produce a C++ rvalue of type int from this Python object of type numpy.int64()). Then I will show you how to solve this problem. Here is an python example code. ----- # # test pass object 2 module, python side implementation # Copyright (C) 2012 Hitoshi # import numpy import passobj2_mod class TriMesh(object):     """TriMesh: simplified triangle mesh primitive for python.boost     demo"""     def __init__(self, _mat_name):         """default construc

Optimist

Most of the nuclear fuel fall down: Fukushima Daiichi reactor. (Asahi.com 2011-11-30) http://www.asahi.com/national/update/1130/TKY201111300697.html According to the simulation, the fuel melted the bottom concrete 65cm , but we still have 37cm remains. Tough challenge to dismantle the reactor ( NHK Fukushima Daiichi Reactor news 2011-12-01) http://www3.nhk.or.jp/news/genpatsu-fukushima/20111201/0705_hairo.html According to TEPCO's simulation, the concrete wall may remain 37cm. News Video: http://www.dailymotion.com/video/xmojmy_yyyy-yyyyyyyyy_news NHK Science and Culture: 37cm remains  http://www9.nhk.or.jp/kabun-blog/600/102712.html

A relationship between eigenvalues and determinant

This year started with heartbreak. The multiplication of all the  eigenvalues is determinant of the matrix. (and the sum of all the  eigenvalues is trace of the matrix. These properties are amazing!)  I read an astonishing simple proof using diagonalization of a matrix. This blog is about that proof. Matrix A can be diagonalize to Actually, the way to reach this is a bit long and the proof I will show you here is based on this. But, I hope you could agree this. The determinant of this relationship is By the way, Because, A determinant is a scalar value, therefore, they are commutative. Therefore, What a simple proof this is! But, one thing we need care: this is only true when $S^{-1}$ exists. So, this is not a complete proof, but, I like this simple proof. References Gilbert Strang, Introduction to Linear Algebra, Chapter 6.