Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- LOAD ERROR



  Fix issue "cannot load such file -- bcrypt_ext (LoadError)"

bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project for hashing passwords. The bcrypt Ruby gem provides a simple wrapper for safely handling passwords. However, sometimes the rails application would fail to start after installing the bcrypt gem on Windows. The error would look similar to below. The issue is that it fails to load the bcrypt_ext which is the native built extension, the reason may be the library is wrongly built. To fix this issue, below steps can...

   RUBY,SOLUTION,RUBY ON RAILS,BCRYPT,LOAD ERROR     2017-03-05 00:21:10

  combining dwarf failed: unknown load command 0x80000034 solution in GoLang

In case there is below error encountered while running some go program: combining dwarf failed: unknown load command 0x80000034 This may be due to that you are running go 1.16 on a Mac M! machine. If you go to check go version, it may tell you that you are running an arm version of go. go version go1.16.10 darwin/arm64 In such cases, you can try below methods to workaround the issue. Try to upgrade the go version to 1.17 and run the code again. If this is not an option for you because you have t...

   GO 1.16,0X80000034     2021-11-25 07:11:28

  An easy way to log client side information to server

JavaScript debug is a very troublesome thing in web application development. Because many web browsers will not notify you if there is any error in the JavaScript codes you write. They just silently fail and block the following codes execution. In order to debug JavaScript codes, we need a good log mechanism which will help us log the error information,, we often need to log errors in JavaScript codes to server for debug purpose in a production web application, What should we do? The first ...

   JavaScript log, Ajax,Image,Debug     2012-12-30 09:16:50

  How to handle ES6 modules in NodeJS

In modern JavaScript, there are two types of modules: ES6 module and CommonJS module used by NodeJS. These two types of module are not compatible. Many people would wonder how to load ES6 modules in their NodeJS project. This post will show how this can be done. Difference The syntax of the module being loaded is different. CommonJS modules are loaded with require() and exported with module.exports. ES6 modules are loaded and exported using import and export respectively. Merchanismwise require(...

   NODEJS,COMMONJS,ES6     2020-08-28 22:01:33

  Be careful about printing error as string in GoLang

In GoLang, we can format and produce string using fmt.Printf(), just like C, GoLang also supports format verbs like %s, %d which can be placeholder for different types of values. But please pay attention when printing error as string so that you will not fall into some trap. Let's first take an example code snippet and see what trap we are talking about. package main import "fmt" type A string func (a A) Error() string { return fmt.Sprintf("%s is an error", a) } func main() { a := A("hello...

   STACKOVERFLOW,GOLANG,FMT     2019-01-23 09:17:15

  Some cases where MySQL cannot be started

After installing MySQL, when we try to start MySQL, sometimes we may not be able to start it. The reasons can be different. We share some general cases where MySQL cannot be started. Case 1: Directory or file permission issue If the permission is set wrongly in MySQL's $datadir and its sub directories or files, MySQL will not be able to read and write files normally. Error message: mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data /usr/local/mysql/bin/mysqld_safe: lin...

   MySQL,Error,Log     2013-08-15 03:32:36

  Understanding PGO in GoLang 1.20

Background The Go 1.20 version was officially released in February 2023, it introduced the PGO(Profile Guided Optimization) mechanism. The basic principle of PGO can be divided into the following two steps: First, profiling is performed on the program to collect data about the program's runtime and generate a profiling file. When compiling the program, enable the PGO option, and the compiler will optimize the program's performance based on the content in the .pgo file. When compiling a program...

   GO 1.20,PGO,GOLANG     2023-02-28 04:27:46

  The difference between System.load and System.loadLibrary in Java

When writing code using native library in Java, normally the first step is loading some native library. static{   System.load("D:" + File.separator + "Hello.dll"); } JDK provides two ways to load libraries: System.load(String filename) System.loadLibrary(String libname) This post will try to explain the differences of these two ways. According to Java Doc on System.load(), it has below description. Loads the native library specified by the filename argument. The filename a...

   NATIVE,JNI,JAVA,SYSTEM.LOAD,SYSTEM.LOADLIBRARY     2019-02-05 05:49:28

  Be careful about nil check on interface in GoLang

nil check is frequently seen in GoLang code especially for error check since GoLang's special error handling convention. In most cases, nil check is straight forward, but in interface case, it's a bit different and special care needs to be taken. Take a look at below code snippet and guess what the output will be. package main import ( "bytes" "fmt" "io" ) func check(w io.Writer) { if w != nil { fmt.Println("w is not nil") } fmt.Printf("w is %+v\n", w) } func main() { var b *bytes.B...

   INTERFACE,GOLANG,NIL CHECK,NIL TYPE,NIL VALUE     2019-04-06 07:47:07

  37 powerful Linux shell commands

To work on Linux platform, you cannot avoid using shell commands to complete some tasks. These tasks can be as simple as list files in some directories or find some text in some file, or can be as complex as monitoring processes. In this post, we will share 37 powerful Linux shell commands.   Task Commands 1 Delete file with 0 byte(empty file) find . -type f -size 0 -exec rm -rf {} \;find . type f -size 0 -delete 2 Check process memory consumption ps -e -o "%C : %p : %z : %a"|sort -k...

   Linux command,List     2013-09-16 07:47:16