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

 PROGRAMMING


  git reset vs git revert

When maintaining code using version control systems such as git, it is unavoidable that we need to rollback some wrong commits either due to bugs or temp code revert. In this case, rookie developers would be very nervous because they may get lost on what they should do to rollback their changes without affecting others, but to veteran developers, this is their routine work and they can show you different ways of doing that.In this post, we will introduce two major ones used frequently by developers.git resetgit revertWhat are their differences and corresponding use cases? We will discuss them ...

101,345 14       GIT GIT RESET GIT REVERT


  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 mainimport "fmt"type A stringfunc (a A) Error() string { return fmt.Sprintf("%s is an error", a)}func main() { a := A("hello") fmt.Printf("error is %s", a)}What do you expect the output is? Do you expect "error is hello is an error"? Unf...

21,238 2       STACKOVERFLOW GOLANG FMT


  9 Outstanding Ways Artificial Intelligence Can Transform Retail

Artificial intelligence has been around for quite some time. However, Amazon was the first company to apply it in the retail industry. Now, it automates most processes on the platform, replaces the people's’ work, and increases the productivity in every possible field.Here are nine useful ideas for you to start using AI in retail.1. Tracking the Overstock and Out-of-Stock ItemsIt is necessary to know exactly how many items are left in stock (or whether there are any left at all). Sellers lose way too much money every year because they lack up-to-date information. Customers can switch to ...

888 0       BUSINESS ARTIFICIAL INTELLIGENCE


  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。BasicWhat is primitive data type? How many primitive data types in Java? What are they?-- A primitive type is predefined by the language and is named by a reserved keyword. Primitive values do not share state with other ...

9,005 0       JAVA SECURITY INTERVIEW CAREER MULTITHREADING QUESTION JAVA INTERVIEW JAVA CORE


  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.String s = "abcd";s = s.concat("ef");When this piece of code is executed, a new String instance is create...

10,038 0       JAVA STRING JAVA 8


  Tips on Writing for Tech Blogs

If you know your stuff when it comes to tech, you might be inspired to start contributing articles to tech blogs. A friend or colleague may suggest the idea to you, or you may see an invitation for submissions, much like the one on this website. Sounds like a great idea; but what do you know about writing articles, blog posts, or other types of content? Writing is a skill, and there are also practical aspects to writing that you need to be aware of before you start creating your own pieces. Getting started as a tech writer means addressing each of the following factors to ensure a successful a...

609 0       TIPS TECH BLOG


  Why can System.out.println be used to exit while loop

Let's first take a look at one simple Java thread code snippet which is supposed to exit the while loop after the first loop run.public class StopThread { private static boolean stopRequested; public static void main(String[] args) throws InterruptedException { Thread backgroundThread = new Thread(new Runnable() { @Override public void run() { int i = 0; while (!stopRequested) { i++; } } }); backgroundThread.start(); TimeUnit.SECONDS.sleep(1); stopRequested = true; }}But the truth is that the loop may not exit and keep running. The reason is that the updated stopRequested value will be in the ...

2,342 0       JAVA THREAD VOLATILE


  Impact of AI on UI/UX design

The growth of computerization and Artificial Intelligence implanted into our regular daily existences in the course of recent years is only productive, we're no longer talk about fantasy since machines are going on at this very moment. This quick advancement has propelled a radically new age of designers to search for client-focused arrangements through the extent of these innovations. Along these lines, we need to investigate what this implies for UX plan in 2018 and what standards we should grasp to be fruitful in our methodology.1. Think cooperatively, not intenselyArtificial intelligence f...

1,316 0       AI UI UX