A Collection of Random Things

Things I come up sometime

An interesting problem, given some numbers, group them into individual sets based on certain rules. For example, for numbers between, we group them into sets (0, 0), [1, 5), [10, 30), [30, 60), [60, 100]. I found this article on topcode is very helpful. Below is an implementation in C++.

Read more »

Recently, I accidentally poked into the frontend development code of some company. That website does not use too many frontend
frameworks except for jQuery and another one I am going to talk about today – RequireJS.

Read more »

I am exploring ReactJS a bit further. I think the key part to understand is how data flows between compoents. The rule is “Data (props) flows from parents to children while events bubble up from children to parents. State or props change will cause compoents to refresh.”. With this in mind it is easy to create a dynamic UI. Today, I am going to create a simple UI that gets all the svgs from a static folder, and give user a list of svg files so they can choose to display selected svg. This is like a very simple file server.

Read more »

I am doing a new project recently so I am trying to follow the react.js tutorial and make use of this new technology in my project. It is claimed that the concept of react.js is fondamentally different from AngularJS. For example AngularJS is a full MVC framework but ReactJS is only the View of the MVC. The following figure demonstrated the whole concept.

Read more »

Tried a little big ngView and ngRoute, the basic concept is not so difficult to grasp. It is like regular V and C in MVC.
The function of this ngApp is to display different images when click on different links. Traditionally, using jQuery, we can just update the src of the image.
This ngApp is just for demo, i don’t think it has more advantage than just using jQuery. But it does quite fun to think of this in a VC way.

Read more »

I have been learning AngularJS recently. Although people say Angular might be okay for small scale websites, it becomes very slow as the website grow larger. Many people turn to React.js for better performace. But I do think it
is useful to learn the concept of Angular since it has been there for quite a while and there are a lot of cool concepts.

Read more »

Today I committed a modifed version of Python-Markdown. Previously, this pip library only supports fenced block at document root level. It is quite inconvenient as often times, we need to nest a code blog inside an ordered list. You can check my previous post for a demo.

Read more »
0%