Getting Started with JUnit 5: Test your Spring MVC Application with it

In this post, we described how to use JUnit 5 to test your Spring MVC application with Maven. Setup Maven Dependencies We can get the required dependencies by declaring the junit-jupiter-api (version 5.x) dependency in our pom.xml file. This dependency provides the public API for writing tests and extensions. If we are using an IDE that is bundled with an older JUnit 5 version, it throws an exception when we try to run our unit tests by using our IDE. We can fix this problem by adding the following dependency to our POM file: The junit-platform-launcher provides a public API for configuring and launching tests. The API is typically used by IDEs and build tools. To test Spring application, we…

Continue Reading

Lua in a Nutshell: A Quick Tutorial for Lua

I'm reading source code written with Torch these days. Torch is a well-known deep learning framework written by Lua. So I summarize the grammar of it and provide a quick tutorial here. Run As we know, Lua is a C-like language. Therefore, it is case-sensitive. The following code outputs "Hello World" with Lua. Note that the semicolon at the end of a line is optional, like JavaScript. You can use the interrupter of Lua in the command line: Also, you can run a Lua script with a file in the command line: Grammar Comment Variables The numbers in Lua are all doubles with 64 bits. And you can use following expressions: You can use both double and single quotes for…

Continue Reading

Making Requests Non-blocking in Tornado

Tornado is one of the most popular web framework for Python, which is based on a single thread IO loop (aka event loop). You can handle high concurrency with optimal performance. However, Tornado is single threaded (in its common usage, although in supports multiple threads in advanced configurations), therefore any "blocking" task will block the whole server. This means that a blocking task will not allow the framework to pick the next task waiting to be processed. For example, this is a wrong way of using IOLoop: Note that get_complex_result() is called correctly, but it is blocked by time.sleep(5), which will prevent the execution of the following tasks (such as a second request to the same function). Only when the…

Continue Reading

Install QQ/TIM in Linux with Wine

This tutorial introduces how to install QQ/TIM in Linux with Wine, which had been tested on ArchLinux with Wine 2.4. Prerequisites Before start, you need to get the latest Wine. I'm not sure whether QQ/TIM can run on lower version of Wine. In ArchLinux, you can easily get the latest Wine using following command: However, in Debian, you need to install Wine with some more steps. You can see this tutorial. Then, you need to install a helper of Wine, Winetricks. Winetricks is a script to download and install various redistributable runtime libraries needed to run some programs in Wine. To install Winetricks, you can use following command: After that, we need to fix some problems manually caused by Winetricks. According…

Continue Reading

Install SciPy on Windows

In this tutorial, you will be setting up a numerical Python development environment for Windows 10. As you might have already realized, Python is rather simple to setup on a Linux/macOS box but as with many open source based projects getting up and running on Windows is never trivial. Good solutions for Windows are, Enthought Canopy, Anaconda (which both provide binary installers for Windows, OS X and Linux) and Python (x, y). Both of these packages include Python, NumPy and many additional packages. However, you can still install these packages manually. Prerequisites Before you start, I assume that you have installed Python with pip on your Windows correctly. You need to download following packages: Microsoft Visual C++ Compiler for Python 2.7 Source…

Continue Reading

Configuring Apereo CAS

This tutorial is designed to help a new CAS user to setup Apereo CAS server and client to their applications. The code of this tutorial is open sourced on GitHub. What's CAS? Enterprise Single Sign-On - CAS provides a friendly open source community that actively supports and contributes to the project. While the project is rooted in higher-ed open source, it has grown to an international audience spanning Fortune 500 companies and small special-purpose installations. CAS provides enterprise single sign-on service for the Web: An open and well-documented protocol An open-source Java server component Pluggable authentication support (LDAP, database, X.509, 2-factor) Support for multiple protocols (CAS, SAML, OAuth, OpenID) A library of clients for Java, .Net, PHP, Perl, Apache, uPortal, and others Integrates with…

Continue Reading
Contact Us
  • Room 614, Zonghe Building, Harbin Institute of Technology
  • cshzxie [at]