Javascript, JS

[3 Steps] Customize theme for Ant Design with create-react-app 2019

BACKGROUND In order to alter the theme of Ant Design, there are multiple target files that we have to change. The most important file will be the webpack config file, however, it is hard to access it directly. The file is located inside the folder of node modules:

We can also make use of npm run eject directly to get…

Continue Reading

Python

Hands On Machine Learning – Example 1.1 with CSV

Required CSV oecd_bli_2015.csv gdp_per_capita.csv   prepare_country_stats()

  Completed code for example 1.1

  Plotting using sklearn.linear_model.LinearRegression():                         Plotting using sklearn.neighbors.KNeighborsRegressor()with sampling n = 3:

Unity

[UNITY] Character & map collision, Arrow key access

                  Character & map collision First of all, BoxCollider2D are required and added to both character and map tiles to make sure proper collision detection. Rigidbody2D allows us to connect the physical properties of the character and access it from the C# script. Initialize the object before the Start() function

  In start(), we…

Continue Reading

std

std::vector

Declaration

  Simple operation

  Fill with something

  Combine two vectors

  In-place solution for creating object

Originally, object gets created first in the main stack and then copied to the vector’s memory address

In-place object creation can be achieved and save the computing time for copying the object

 

Algorithms, C++

My dynamic programming journey [2] – Coin change problem

As suggested in both Quora and StackOverflow, the coin change problem should be the second problems for beginner to solve. There are actually multiple variations of this problem, however, my approach will be finishing the basic version first, which is: Given a set of coins with values, find the possible way to form N (order is not considered). Example: Given…

Continue Reading

Algorithms, C++

My dynamic programming journey [1] – Fib with memorization

It is rather complicated to consider the advance level of dynamic programming at the beginning, so I have decided to start with a basic example: finding Fibonacci numbers. Since the concepts of recursion and memorization are often required in dynamic programming, therefore, I have implemented a version of memorization. Set base case of 0 and 1 equal to 1 Check…

Continue Reading

Fix, Python

[Debug] no name in module error in pylint and flask

Problem The following errors occur in visual code editor

  Solution It should be an import error of from urllib.request import urlopen, which I am trying to use modern python3 library. Similarly, same errors keep popping up during the bootstrap of flask server. It can be concluded that the error is caused by the conflicts of python version, which the…

Continue Reading

Gatekeeper

[Debug] Vagrant vm setup – 3

Problem The following lines are not fatal error but still needed to be solved

    Approach 1. The network adapter is incorrectly assigned and I will match the device accordingly in the provision.sh Since we are able to ssh into the vagrant, we can check the interface mapping by

The content of interface mapping file

Which…

Continue Reading

Gatekeeper

[Debug] Vagrant vm setup – 2

Problem The memory allocation failed during the vagrant up –provision

    Approach 1. As we are using the cloud image from vagrant, the kernel contains the minimal dependencies, therefore, some modules required are missing.  I will append the linux-generic to the provision.sh to ensure the modules uio and uio_pci_generic are corrected configured. Result: The following two lines are…

Continue Reading

Gatekeeper

[Debug] Vagrant vm setup – 1

Problem I’m trying to create the virtual machine using vagrant for the dpdk, however, the screen was freezing at this period of vagrant up

  Approach 1. Making sure the conflicts is not caused by the conflicts of version between vagrant and virtual box. Result: I have downloaded the archive of both software and do a mix and match. However, the…

Continue Reading