Through the binary

a full stack enthusiast interested in Javascript / Typescript / Kotlin / Python / React / React Native / (Android & iOS) native / Cloud

Previously, when I tried to debug the failed test in mocha, I start mocha in bash with --debug-brk, and attached the Visual Studio Code to that mocha process. My code is written in ES6, and I run mocha via babel-register. When I tried to enjoy the built-in debug function in VSC. Somehow, the stack seems completely irrelative to the actual code. Take me a while to figure it out. I searched a lot online, assembled all the information to solve the problem, I think it worths a blog to save someone else time.

Read more »

When you are developing some cross platform apps, React native, Phonegap, Kivy, Native script, etc. It’s very usual that you need to install the package to the real device, and it’s totally fine for you to manually install the compiled APK. But if you want more productivity, you need use the adb command. Let’s get a quick look for all of these.

Read more »

Testing is a crucial part for developing, for JavaScript as well. Since the foundation theories of testing is almost the same regardless of the languages you are using. I will focus on introduction to Mocha and Chai, and environment setting up in this article. And for both ES5 and ES6. And the library we are using is Mocha and Chai. Mocha is a BDD testing framework and Chai is an assertion library. And at the end, I will talk about why I don’t use Jasmine for testing.

Read more »

Objects are somethings which exists at run time, if we want to maintain its status across sessions, we need some intermediate technology such as serialization. With serialization you could flush the objects to the disk to make it persistent and deserialize it afterwards to convert it back from binary form to a runtime object.

Read more »

Previously, we have been through the insertion sort, an interesting idea, this time, let’s look into something relatively normal. Selection sort, which is an algorithm very similar to the mind of human being when doing a sort.

Read more »

1. Brief:

  • Kivy is a framework which enable you to write cross platform app via python, and buildozer is a tool to package your code. Their documentation really sucks, this is why I wrote this to save you tons of time.
  • Kivy provides a bundle package for OS X, which you can use a executable file named kivy to run your code instead of the native python one. But if you prefer the pythonic way (as I do), You could use this tested solution as a reference.
  • Tested for Kivy 1.9.1, OS X Sierra 10.12.1 and Python 3.5, for python part, I tested 3.5.0, 3.5.1, 3.5.2;
  • Couldn’t make it via python 3.4.5
  • For the future version: If you can’t make it running under some specific python version, just try to adopt the python version in the Kivy Mac Bundle. This is how I solve it.
Read more »

1. Brief:

  • Kivy is a framework which enable you to write cross platform app via python, and buildozer is a tool to package your code. Their documentation really sucks, this is why I wrote this to save you tons of time.
  • Make sure you have follow through How to run Kivy application via python3 under OS X? and make it work.
  • It’s tested for Kivy 1.9.1, Python 3.5.2 and Buildozer 0.32 on OS X Sierra 10.12.1
  • The first time packaging could be time consuming and throttling your laptop but that is OK, after downloading and compiling the libs, the future packaging could be fast
Read more »

The best way to learn a sorting algorithm is not coding, but demonstrates it. Insertion sort is such a good start to practice your sorting. The first confusion may start from the name, “insertion”, most of the time, we are talking about insert new item into a collection. But in sorting, the overall array is just there, no more and no less. Why do we call it “insertion sort”?

Read more »

VIM is a great editor, but it will confused you at first since its unique design. But I still think you should learn it since it seems a must-have for every developer nowadays. Especially when you need to deal with some bash-heavy works.

And VIM is really just about shortcuts, you know them, use them, and you conquer VIM. Now I share the 29 shortcuts which I use a lot in daily. There are tons of them. But these 29 are the most intuitive ones and very easy to remember. You can be an efficient VIM user if you learn these 29 well I believe. :)

Read more »
0%