Meng Xuan Xia

  • Home

  • Archives

  • Tutoring

  • Projects

  • About

  • Tags

Running Python Test Cases in Desired Order

Posted on 2018-05-31 | Comments:
Symbols count in article: 1.1k | Reading time ≈ 1 mins.

Good codebase are well tested, not necessarily in aiming towards 100% test coverage. But core algorithm are at least covered in unittests; and major system workflows, covered in integration tests. While it is a common practice to assume unit tests to be independent and stateless, it is not always true with integration tests.

In this short example we have an integration test where the flow is to first preprocess the item and then compute its score.

Read more »

The ecosystem of React Native can be improved, beyond technically

Posted on 2018-05-09 | Comments:
Symbols count in article: 4.4k | Reading time ≈ 4 mins.

Facebook’s React Native is a fantastic tool. It brings the well-received React onto the mobile platforms and enables the developers to program platform agnostic mobile apps using modern tools and techniques. Today, many apps of large user base are written in React Native, such as: AirBnb, Discord, Instagram and others.

Given its wide adoption, as well as amazing ease to target both iOS and Android with a single code base, it’s an ideal choice for Calvin Payments, a solution that my co-founder and I created to help people pay their restaurant bills faster and more easily.

In practice, developing in React Native is a bittersweet experience. Here’s why:

Read more »

XYT-CPU: A 8 bit CPU built from scratch in Logisim

Posted on 2018-03-15 | Comments:
Symbols count in article: 10k | Reading time ≈ 9 mins.

This is an old course project I did at McGill for COMP 273 – Computer System. The goal is to create a CPU in Logisim using none other than the primitive logic gates. Although the CPU project is old and other better designs certainly exist, I still feel that this project’s structure organisation and its bundled assembler have some educational merits. The CPU is called XYT-CPU, named after the initials of the project members.

Read more »

Five different Rails dev environment on Windows 10

Posted on 2018-02-18 | Comments:
Symbols count in article: 7.6k | Reading time ≈ 7 mins.

Developing rails application on Windows used to be painful in the pre-jruby and pre-RailsInstaller era. Most Rails developer in the early 2010 run on either OSX or Linux. As of today, there are five different ways to setup a Rails development environment on Windows 10. When I started working on the Rails project of my current job, I spent quite some time playing with different alternatives. This article tries to give an introduction to each of them and evaluate their pros and cons.

Read more »

Modify a Rails 5 project to run on both MRI and JRuby

Posted on 2018-02-02 | Comments:
Symbols count in article: 3.2k | Reading time ≈ 3 mins.

It’s 2018 and running Rails on Windows is still as painful as many years ago. Probably because all the Ruby people love and use a Mac. JRuby is a good alternative to MRI and does not require building native extensions. This is a quick note on how to modify a Rails 5 project so that it runs on both MRI and JRuby.

Adding JRuby support, an iterative process

Throughout this guide we will be going through this process repeatedly.

  1. Run bundle install
  2. Hit an error because a gem that_mri_only_gem does not work on JVM and is trying to build native extension
  3. Modify Gemfile so that that_mri_only_gem is only included in mri platform
  4. If required, find a jvm compatible gem to replace it.
Read more »
1234…16

Meng Xuan Xia

Blog posts on math, computer science, software development and NLP.

78 posts
5 categories
82 tags
RSS
Github
© 2013 – 2022 Meng Xuan Xia | 225k | 3:25