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

SEARCH KEYWORD -- Operator



  <=> operator in MySQL

Have you ever seen "<=>" in a SQL query while using MySQL? Does it mean less and equals to and greater than? Actually if you consider it as the union of <= and =>, great, you are close to it. This is one form of equal operator in MySQL, it has the similar meaning to the = operator with some subtle difference. According to MySQL documentation, <=> is NULL-safe equal. This operator performs an equality comparison like the = operator, but returns 1 rather than NULL if both operand...

   MySQL,NULL safe,<=>     2014-03-24 06:23:22

  JavaScript's New Features: Exploring the Latest Additions to the Language

As the web continues to evolve, so too does the JavaScript ecosystem. With the release of ECMAScript 2023 (ES2023), JavaScript developers can now leverage a range of new features that promise to improve code quality, readability, and maintainability. In this blog post, we'll dive into some of ES2023's most exciting additions and provide practical examples of how they can be used in your projects. 1. Private Fields and Methods in Classes One of the most anticipated features in ES2023 is the intro...

   JAVASCRIPT,ES2023     2023-04-16 01:41:58

  new expression vs operator new in C++

In C++, there is a new mechanism for memory allocation and management. When we want to initialize an object, we can use new expression to get enough memory for storing an object and also initialize the object. When we want to create a new object, we can use new expression, for example: Obj *obj=new Obj; Basically, what the new expression does is to allocate enough memory for storing the obj object, in addition, it will initialize the object with some intial values. Also, there is an operator new...

   C++, new expression, operator new     2012-08-12 11:42:39

  malloc/free and new/delete in C++

malloc and free are C++/C language standard library functions, while new/delete are operator of C++. They can be used to allocate dynamic memory and free memory in C++ programs malloc/free can not meet the requirements of dynamic objects creation. Object needs to call the constructor to initialize the object when creating, the object needs to call the destructor before it is destroyed  Since malloc() and free() are library functions rather than operators, the compiler has no control permiss...

   C++,memory,malloc,free,new,delete     2012-06-20 06:52:09

  Why you should be careful about optimizations

In one of my current javascript projects, I have to deal with 3D voxel coordinates. And, sometimes, I have floating points coordinates which must be converted to integers in order to convert them into proper array index. Javascript is a wonderful language, really. However, implementations are sometimes weird, and the way to do something can sometimes have very huge impacts on the performances. Worse, sometimes the classical way is more expensive than the tricky one. So, some peo...

   JavaScript,Bitwise,Floor,Trick,Optimization     2012-05-02 11:29:20

  Accurate floating point number calculation in JavaScript

In JavaScript, since floating point is defined with IEEE754,there will be some accuracy issues while doing floating point number arithmetic. Here is a function which can resolve the accuracy issue. var calc = function(num1,operator,num2,len){    var numFixs = function(num){        var arr = num.toFixed(len).toString().split('.');        return parseInt(arr.join(''));    }    switch(operator){...

   JavaScript, floating point,IEEE 754,accuracy     2012-12-27 11:07:49

  Only 4G can resolve the conflicts between China Telecom Carriers and WeChat ?

Why WeChat has made the three big Chinese telecom companies uncomfortable? Let's analyze from both technical and commercial levels. From a technical point of view, Mr. Huang, Dean of China Mobile Research Institute, described the impact of "always online service" applications like WeChat. Instead of using technical terms, we will explain in simple vivid phrases. First, mobile QQ, or WeChat, will have their own "request frequency". These requests are sent to the carrier network, to check the re...

   4G,WeChat,Telecom,China     2013-03-25 08:28:59

  Go Lacks Ternary Operators. Here Are Some Equivalents

If you were like me, a pure Java developer before writing Go, you must be wondering why Go doesn’t support the ternary operator like return a > 1 ? 0 : 1. Most mainstream languages like C and Java are supportive of ternary operators; languages like Python and Ruby support the simplified if-else one-liner, such as a = 0 if a > 1. However, Go is not among them. And it is not only about adding operators but also a concept of coding in a more convenient way, such as the ?: expression can...

   GOLANG,TERNARY OPERATOR     2022-12-09 19:51:32

  What will the value of Integer.valueOf(127) == Integer.valueOf(127) be in Java?

Do you really understand how Java does the integer comparison? OK, ignore the statements in the post title. What we are interested in is another set of comparison statements. Let's first see below code snippet. public class IntegerComparison { public static void main(String[] args) { Integer a = 127, b = 127; Integer c = 128, d = 128; System.out.println(a == b); System.out.println(c == d); } } What do you think the output will be? Are they both displaying true? You will find out t...

   JAVA,==,EQUALSTO     2018-01-13 22:18:15

  Why using + to concatenate string in Java loop is not a good option

String concatenation is a common operation in Java programming. It is to concatenate multiple strings into a single string. Java provides a String class which is an immutable class which means the object cannot be mutated once instantiated. Once a String object is instantiated, its properties cannot be changed anymore, so when concatenating strings, it's actually create a new String instance to store the concatenated string values. For example, below is a simple string concatenation example. Str...

   JAVA,STRING,JAVA 8     2019-01-18 22:07:12