有時候開機會莫名出現以下相關的訊息後就卡住了
/dev/sda*: clean, *******/******* files |
排查了一下發現問題常常是出在 Nvidia 的 driver 沒有正確被啟動
有時候開機會莫名出現以下相關的訊息後就卡住了
/dev/sda*: clean, *******/******* files |
排查了一下發現問題常常是出在 Nvidia 的 driver 沒有正確被啟動
Since C++11, std::decay
is introduced along with
<type_traits>
. It is used to decay a type,
or to convert a type into its corresponding by-value
type. It will remove any top-level cv-qualifiers(const
,
volatile
) and reference qualifiers for the specified type.
For example, int&
is turned into int
and
an array type becomes a pointer to its element types. Knowing its usage,
we could try to implement our own version of
std::decay
.
In C++, even though a function generated from a function template has the same name and the same type as the ordinary function, they are never equivalent. Besides, the non-template function is more preferred:
1 | template <typename T> |
On top of that, it is not easy to templify a copy/move constructor because the compiler may implicitly define a copy/move constructor.
Support vector machine (SVM) plays an important role in machine learning. Actually, SVM is one of my favorite models because of its analytical property. Its main idea is to find the optimal hyperplane that can linearly separate the data, or maximise margin in the feature space. It is one of the most robust models based on statistical learning framework in VC theory (Vapnik–Chervonenkis theory). The determination of the model parameters is a quadratic programming problem, or convex optimisation more specifically. Its solution is usually sparse, and the new input prediction depends only on the evaluation of a subset of training data with kernel function. One of the most common and efficient approaches to train SVM is sequential minimal optimisation (SMO), which breaks down the problem into solving a pair of parameters analytically at each step. Besides, SMO also eliminates the need for matrix storage issue when the training data size is huge.
Sometimes, we may wanna simulate certain random variable to get the desired approximation. Yet, if the scenario is rather complicated, the computation cost can be exorbitant. With the help of inverse transformation method, we are able to generate many special random variables efficienctly.
When we develop our program or the system continues to grow as time
goes by, memory leakage is usually a pain we suffer
most. To militate against this problem, C++ has introduced smart pointer
family - unique_ptr
, shared_ptr
,
weak_ptr
, defined in header <memory>
,
since C++11.
Precisely,
unique_ptr
inherits most of characteristics fromauto_ptr
, which has been implemented since C++03. Yet, due to the lack ofmove
semantics, it encounters significant limitation:Note that
1
2
3
4
5 auto_ptr<int> p (new int(1));
vector<auto_ptr<int>> vec;
vec.push_back(p); // !!! error, because of Copy constructor
vec.push_back(std::move(p)) // Okay, with move semantics since C++11auto_ptr
is deprecated now and should not be used any more for safety.
C++ provides a plethora of containers that allow us to dynamically
allocate our elements in run time. Take vector
as an
example. It is widely used in many applications. However, for some
extreme cases, we may still want to avoid the overhead of reallocation
or copy operations when those operations are quite expensive.
Since C++11, with the advent of emplace
methods,
developers are able to pursue more efficiency via them.
Brownian motion is a phenomenon that particles in the seemingly motionless liquid are still undergone unceasing collisions in an erratic way. It was firstly observed by Robert Brown in 1827. In 1923, Norbert Wiener had attempted to formulate this observations in mathematical terms; thus it is also known as Wiener process.
Owing to its randomness, Brownian motion has a wide range of applications, ranging from chaotic oscillations to stock market fluctuations. In this article, I will describe its basic property and how to visualise it and its variants with Python.
設定好 fcitx 的行列輸入法時,會發現有無法正常使用標點符號的問題 (i.e.
W
+ 2
沒反應)
這部份需要更新 fcitx 的字碼表,來修改 W
+ 1
~ 9
的行為
每一次重新安裝好用來開發的Linux環境時,總會因為自己是使用較小眾的行列輸入法,常得在過程中的安裝和設定上掙扎許久...
以往這些紀錄都只會留存在我個人的 Evernote;受惠於網路甚多,現在決定開始把這些過程重新整理並分享給有需要的人
以下步驟也適用於倉頡、大易、速成、嘸蝦米等中文輸入法