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

SEARCH KEYWORD -- Arrays.equal()



  Arrays.equals() vs MessageDigest.isEqual()

Both Arrays.equals() and MessageDigest.isEqual() are used to compare the equality of two arrays. They can be interchangeably in many cases. However, they do have some differences which lead to different use cases in real applications. One difference is that the arrays passed to MessageDigest.isEqual() cannot be null while it's ok for Arrays.equals(). The one major difference between these two methods is that Arrays.equals() is not time-constant while MessageDigest.isEqual() is time-constant. Thi...

   Arrays.equal(),MessageDigest.isEqual(),Java,Security     2015-05-14 22:03:29

  JavaScript: Passing by Value or by Reference

In JavaScript, we have functions and we have arguments that we pass into those functions. But how JavaScript handles what you’re passing in is not always clear. When you start getting into object-oriented development, you may find yourself perplexed over why you have access to values sometimes but not other times. When passing in a primitive type variable like a string or a number, the value is passed in by value. This means that any changes to that variable while in the function are com...

   JavaScript,Function,Pass by reference,Pa     2011-07-28 11:05:25

  Comparable and comparator in Java

Comparable and comparator are two similar interfaces used to compare objects in Java. When we want to sort a list of objects such as Employee or User etc, we may need to implement these interfaces to make them comparable as we want. However, there are some differences between comparable and comparator interface.ComparableA comparable object is capable of comparing itself with another object. The class itself must implements the java.lang.Comparable interface in order to be able to compare its in...

   Java,Comparable,Comparator,Sort     2012-07-04 12:06:15

  <=> 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

  + operation on JavaScript objects

In JavaScript, there are two types of values: primitive and object. Primitives consist undefined, null, boolean, number and string. Other values such as array and function are objects. When applying + operation on different type of values, there would be three kinds of type conversion. Primitive conversion Number conversion String conversion There three type conversions have corresponding abstract operations in JavaScript: ToPrimitive(), ToNumber(), ToString(). For number additi...

   JAVASCRIPT,PROGRAMMING     2018-10-12 22:19:12

  Manipulating JavaScript Arrays

Our first tutorial on JavaScript arrays covered the basics: creating arrays, accessing the contents of arrays, array lengths, and looping through arrays. In this tutorial, you explore arrays in more depth, and learn how to use various methods of the Array object to manipulate arrays. Extracting sections of an array with slice() You're not limited to accessing single array elements at a time. Thanks to the slice() method, you can grab a whole section of an array at once. slice() has the follow...

   JavaScript,Array,Manipulate,Join,Splice     2011-08-07 01:56:06

  Fujitsu CTO: Flash is just a stopgap

Flash is a necessary waystation as we travel to a single in-memory storage architecture. That's the view from a Fujitsu chief technology officer's office. Dr Joseph Reger, CTO at Fujitsu Technology Solutions, is that office-holder, and – according to him – flash is beset with problems that will become unsolvable. He says we are seeing increases in flash density at the expense of our ability to read and write data. Each shrink in process geometry, from 3X to 2X and onto 1X, ...

   Flash,Memory,Bottleneck,Limitation,Futur     2011-08-12 07:31:34

  Java Interview Questions

Currently there are many articles online which summarize the list of Java interview questions. Some cover lots of basic questions and some cover some specific questions in specific area such as multithreading. In this post, we will not cover the really basic questions, we will cover something different. For basic question, you can read Java Interview Questions。 Basic What is primitive data type? How many primitive data types in Java? What are they? -- A primitive type is prede...

   JAVA,SECURITY,INTERVIEW,CAREER,MULTITHREADING,QUESTION,JAVA INTERVIEW,JAVA CORE     2019-01-21 07:07:08

  Restore mocked variables in GoLang unit test

One of the guarding principles of writing unit test is that there should be no real external calls for dependant services. Unit test should run by its own and can run without issues on any environment including local, build, test environment. This indicates there should be some mock responses whenever an external call is needed so that different unit test scenarios can be covered. How can this be done in GoLang? In GoLang, anything can be assigned to a variable even including functions. A variab...

   GOLANG,UNIT TEST,MOCK FUNCTION,RESTORE MOCK     2021-12-10 20:43:00

  Prototypes and Inheritance in JavaScript

Forget everything you know about object-oriented programming. Instead, I want you to think about race cars. Yes – race cars. Recently I was watching the 24 Hours of Le Mans –a popular racing event in France. The fastest cars in the race are the Le Mans Prototypes. Although these cars are built by car manufacturers like Audi and Peugeot, they are not cars you’ll see on the streets and highways of your home town. They are built exclusively for high-speed endurance ra...

   JavaScript,Prototype,Inheritance     2012-02-27 04:55:22