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

 PROGRAMMING


  How many bytes a boolean value takes in Java?

Have you ever wondered how many bytes a boolean value takes in Java? One byte, this might be the answer comes out of your mind right away. But is it? Let's dig in more.Per Oracle documentation on boolean value definition, there is below statement:boolean: The boolean data type has only two possible values: true and false. Use this data type for simple flags that track true/false conditions. This data type represents one bit of information, but its "size" isn't something that's precisely defined.From the description, it mentions that the size of the boolean value is not precisely defined. This ...

15,593 1       BOOLEAN INTERVIEW JAVA SIZE


  How Artificial Intelligence is Changing the Future of Web Design & Development

Artificial intelligence is having a say in how web designs are shaping up nowadays. Many within the industry have even gone on to say that AI is the future of web design and development. The impact of AI on web design and development can be felt by understanding how web design has evolved over the years. Traditionally, all websites were created using HTML. Then, with the advancement of technology, the code structure of websites began to change and became more sophisticated. Now, it has come to a point where designers and developers have started fantasizing about designing and developing websit...

1,157 0       HIRE WEBSITE DESIGNER OUTSOURCE WEBSITE DESIGN SERVICES


  A mini post on GoLang context

In a GoLang web server, every request coming in will be handled by a goroutine. In the request handler, the logic may also need to create new goroutine to handle other tasks like RPC call. When the request is processed and response is returned, these goroutines created need to be exited so that no goroutine leak should happen.package mainimport ( "fmt" "log" "net/http")func main() { http.HandleFunc("/echo", func(w http.ResponseWriter, r *http.Request) { fmt.Println(&r) w.Write([]byte("hello")) }) log.Fatal(http.ListenAndServe(":8080", nil))}go run main.go0xc0000060100xc0000760480xc000076...

11,820 0       GOLANG CONTEXT


  GoLang to build smaller executable file

Normally the executable file built with go is a bit large, it is always desired that a smaller executable file should be generated though. In this post, a couple of ways to reduce the size of the executable will be introduced. The end effect is that the executable file size would be much less than the normal generated one.The file which is built normally has below size.Mode LastWriteTime Length Name---- ------------- ------ -----a---- 12/14/2019 9:47 AM 1974272 main-ori.exeAdd build flags Two ld parameters can be added when usin...

10,595 2       EXECUTABLE GOLANG


  Maintain multiple versions of Go in one single environment

In a development environment, there might be multiple projects going on at the same time and they may require different development environments with different versions of build tool. In many programming languages, it is possible to have multiple versions of different build tool or development tool on a single environment. For example, there can be multiple JDKs, multiple versions of Ruby using RVM. For GoLang, there is a similar tool called GVM which can also be used to maintain multiple versions of Go in one single environment.In this post, we provide a mini guide on how to setup multiple ve...

8,059 0       GOLANG GVM GVM PKGSET RVM


  JSON unmarshal in GoLang

In almost all mainstream programming languages, there is either built-in or third-party library to support parse JSON data because it is so popular for organizing and transferring data among different services. In GoLang, the built in json package also provides functions for marshalling and unmarshalling JSON data. Marshalling GoLang struct to a JSON string is relatively simple, just need to call json.Marshal(), it's a bit complicated to unmarshal an arbitrary JSON string into a GoLang struct object though. This post will try to walk through some scenarios of unmarshalling JSON string to GoLan...

12,361 0       JSON UNMARSHAL GOLANG EMPTY INTERFACE


  Write Your Own R Packages

IntroductionA set of user-defined functions (UDF) or utility functions are helpful to simplify our code and avoid repeating the same typing for daily analysis work. Previously, I saved all my R functions to a single R file. Whenever I want to use them, I can simply source the R file to import all functions. This is a simple but not perfect approach, especially when I want to check the documentation of certain functions. It was quite annoying that you can’t just type ?func to navigate to the help file. So, this is the main reason for me to write my own util package to ...

2,518 0       DATA SCIENCE DATA ENGINEERING R PROGRAMMING


  Fastjson just fixed a bug which might cause out of memory issue

Fastjson just fixed a bug which might cause service down a few days ago. This bug is caused by some mishandling of special character \x which is an escaped character to indicate hexdecimal number. The impact of this bug would be big if the attacker constructs a malicious data which would cause the service down. The code which causes the issue is in com.alibaba.fastjson.parser.JSONLexerBase#scanString, when a JSON string is passed in, fastjson would parse the string character by character, when it finds the \x, it would try to process the following two characters automatically an...

3,018 0       FASTJSON BUG NEWS ALIBABA