Qt QWidget add menu bar
I want to add menu bar to my window (which is a QWidget instance), I searched on the Google and found that most articles are recommending to use QMainWindow instead of QWidget. Using QMainWindow is a...
View ArticleDrupal search without reindex
In Drupal, if you want to let your published node appear in search results, you need to re-index the search first (Administration->Configuration->Search Settings). And the Drupal cron job file...
View ArticleUnable to find vcvarsall.bat when installing gmpy using pip
GMPY is a multiple-precision arithmetic module, which is a extension module written by C. I tried to install it by using pip, then I got following error message: Unable to find vcvarsall.bat It’s...
View ArticleDrupal user properties (status, hostname, etc)
In Drupal, user_load($uid) function will return an user object. And Drupal has defined a global user object as well (it represents current logged in user). The user object has following properties:...
View ArticleNo module named Crypto.PublicKey
When I tried to import the “paramiko” module, I got following error: No module named Crypto.PublicKey That means we need to install pycrypto library. Run following command to install pycrypto library...
View ArticleAccess PHP built-in web server from other devices
We often use following command to start the PHP built-in web server. php -S localhost:port But in this way only the machine which starts the server can access it, any other computers cannot access it....
View ArticleSet sorting layer in unity c#
Sorting layer is a property of SpriteRenderer, it’s used to specify which object is at top, and which object is at bottom. If you want to change the sorting layer in script, you can use following...
View ArticleThe URL is not accessible when installing Magento
When installing Magento, we may get such error “The URL is not accessible”. In some earlier versions of Magento, we can fix this problem by change code of...
View ArticleFabric.js set text color
Fabric.js is a powerful javascript canvas library which wraps html5 canvas operation, and introduces objects (text, shape, path, etc.) to developer. There is a common method set() for object, it can be...
View ArticleHTML set checkbox as readonly
Sometimes we don’t want to make some form fields non-editable to users, like Product ID, Order Created Date, Post Author, etc. For HTML text input and textarea controls, we can add “readonly” attribute...
View ArticleWebServlet cannot be resolved to a type
WebServlet annotation is introduced in Servlet 3.0, it’s used to simplify the servlet creation (we don’t need to define it and its URL mapping in web.xml) The WebServlet annotation usage...
View ArticleQWebEngine crash with exception code 0×80000003
QWebEngine is a new web browser engine introduced in Qt 5.4, it’s used to replace the old QWebView. QWebView is based on WebKit, while QWebEngine is based on Chromium browser, so it’s faster and...
View ArticleCheck MySQL case-insensitive query or table name
I tried to install Umbrao CMS, it supports MySQL database but it need MySQL to support case-insensitive query and table name. Following is way to check whether case-insensitive query is supported:...
View Articlemysql auto backup
First create a shell script which is used to backup database, here we named the script as mysql_backup.sh:current_date=`date +"%y-%m-%d"` mysqldump -u.. -p.. db_name > db_name$current_date.sqlIn...
View ArticleWPF ModernUI Tutorial Part 1
Introduction ModernUI is a nice WPF theme and a styling framework which let you build a modern, beautiful application easily. Are you poor in designing skill and have problem with designing GUI for...
View ArticleWPF Dragablz Tutorial Part 2: Set Custom Tab Host Window
Introduction Dragablz is a WPF Tab Control which can let us to drag and drop tabs, drag tabs out as floating window and docking support, etc. It’s a pretty good control, but its documentation is too...
View ArticleIKVM.NET Convert JAR to .NET (C#, VB.NET) DLL
Why Convert JAR to .NET DLL Imagine your company builds an online file converter, and its backend programming language is Java because of its position in web development. And in this project you build...
View ArticleC# Int (Integer) Infinity
Background I’m implement a data structure which is used to convert a time range to human-readable text, e.g. 0-7 days to “Within 1 Week”, 7-30 days to “1 Week to 1 Month”. Here I use...
View ArticleApache Derby Database Browser
Background Apache Derby is an embed database implemented in pure Java. It’s implemented in pure Java, thus it’s more compatible with Java. There are mainly three database browsers for Derby RazorSQL...
View ArticleWPF Set StartupUri in code
Introduction StartupUri is a property of Application class, which sets the first UI to show when application starts. By default it’s set in App.xaml file, e.g.<Application...
View Article