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

SEARCH KEYWORD -- Error



  errGroup in GoLang explained

Today, let's talk about the usage and applicable scenarios of errGroup, which is often used. Why is it useful? Generally, when we use goroutine, we cannot return a value. If you want to pass out the result of the goroutine execution, you usually have to use the channel. The errGroup package is suitable if you want to know when the goroutine you opened encounters an error during execution and stop working, and I need to know the error value. errGroup usage The package needs to be downloaded and i...

   GOLANG,ERRGROUP,WAITHROUP,CONCURRENCY     2023-05-27 23:58:20

  Handle NXDomain error when resolving IP address in Ruby DNS resolver

In another post, we covered how to resolve SystemStackError when resolving IP address in Ruby. In this post, we would cover another common issue where a NXDomain error is returned when resolving an IP address. The NXDomain error means that the queried domain name does not exist in the DNS. In Ruby, DNS resolver library will use /etc/resolv.conf by default get the name servers to resolve the domain name. There are multiple DNS name servers can be specified in /etc/resolv.conf with below format. ...

   RUBY,RUBY ON RAILS,NETWORK,DNS,NXDOMAIN     2017-07-16 01:39:23

  Strict mode in JavaScript

1. Introduction In addition to normal mode, ECMAScript 5 includes the other mode : strict mode. It means it will make JavaScript codes execute in a more strict environment. The purposes to have strict mode are: Remove some unreasonable and parts of JavaScript syntax. Reduce some of the quirk behaviors. Remove some insecure parts of code execution. Make the execution environment more secure Improve interpret efficiency and increase the execution speed Build foundation for future JavaScript versi...

   JavaScript, Strict mode. Introduction     2013-01-17 05:00:26

  Error handling in GoLang

Error handling is one of the must talked topics for any programming language. The program would be more reliable and stable if errors are handled properly and timely. Each programming language has its own way to handle error, this applies to GoLang as well. This post will discuss more about GoLang's error handling mechanism. Error handling Before talking more about GoLang's error handling, we can see how different programming languages are handling errors. C's error check The most direct way of ...

   GOLANG,ERROR HANDLING,FLUENT INTERFACE     2021-03-06 21:36:08

  Fix issue where no Java virtual machine found when launching Eclipse

In cases where a new Eclipse is installed or the location of the Java virtual machine binaries has been changed, you may face issue when launching Eclipse. The error would look like. And if you go to the location specified in the error message, there is no such path indeed.  And when clicks OK, the program just exits. The issue here is that it tries to find the java.exe binary and launch the program but it failed to locate it and hence exits. To fix this, you first need to ensure you have...

   ECLIPSE,JAVA,LAUNCH,ECLIPSE.INI     2019-09-07 05:31:27

  How to check whether a struct implements an interface in GoLang

Unlike other programming languages like Java, when implementing an interface in GoLang, there is no syntax like below to explicit tell the relationship: type I interface { } type A struct implements I { } When looking at the code or running the code in GoLang, it might lead to a case one doesn't know whether a struct implements interface before trying to use it as some interface. According to GoLang spec, as long as a struct implements all functions of an interface, it is considered as having i...

   GOLANG,INTERFACE,IMPLEMENTATION,CHECK     2020-05-03 00:05:54

  How to hide PHP Notice & Warning Messages

How to hide PHP Notice & Warning Messages. The PHP notice errors are frustrating and you are tired of seeing them when you are working on your scripts. They are showed at the beggining of your pages and may reveal confidential information to the visitor like the path to the file or the php file name in some cases.// Turn off all error reportingerror_reporting(0);// Report simple running errorserror_reporting(E_ERROR | E_WARNING | E_PARSE);// Reporting E_NOTICE can be good too (to report unin...

   PHP,Error,Warning,Deprecated,Hiding,Method     2011-11-18 12:17:26

  An experience on fixing HTTP 406 Not Acceptable error

This post is about an experience of mine on fixing a HTTP 406 Not Acceptable error seen on one of my page. Just got back from a business trip and opened my computer as usual to start to monitor my website statistics. But when I opened the page on showing real time page views, it shows nothing but zero. So I pressed F12 to bring up the developer tool to check on what's going on. The logic of loading the real time page view is backed by AJAX call. In the developer tool console, I see that the rAJA...

   PHP,AJAX,HTML,HTTP 406,CONTENT-TYPE     2019-03-30 04:09:10

  Capture video stream with WebRTC

WebRTC(Web Real-Time Communication) is an API supporting real time audio and video communication through a browser. It is now a recommended W3C standard. This post is to show you how to capture video stream and screenshot with WebRTC. Capture video stream To play video stream from the video camera, we first need to put a video tag in our code: <video id="video"></video> The main function to get the video stream is the navigator.getUserMedia, as of now only few of the browsers support...

   WebRTC,Video,Screenshot     2013-10-24 21:04:41

  Implementing DESede/ECB/NoPadding cipher algorithm in GoLang

By default, GoLang doesn't provide the ECB mode cipher for DESede though there is CBC mode provided. In cases we need to encrypt/decrypt data with ECB mode, we need to implement those by ourselves. This mode is frequently used when encrypting/decrypting PIN block which is small block data less than 16 bytes. In this post, we will introduce how to implement the DESede/ECB/NoPadding algorithm in GoLang by using the existing cipher support. Here we will not cover how DESede works in detail, instead...

   SECURITY,SAMPLE,GOLANG,DES,DESEDE,3DES     2019-07-29 06:43:50