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

 ALL


  Currency list with symbols

For those who want to find out a currency code, name, symbol, numeric code and decimal numbers, below is a simple JSON structure for easy use.[{ "code": "AED", "numeric": "784", "name": "UAE Dirham", "symbol": "د.إ", "decimal": 2 }, { "code": "AFN", "numeric": "971", "name": "Afghani", "symbol": "؋", "decimal": 2 }, { "code": "ALL", "numeric": "008", "name": "Lek", "symbol": "L", "decimal": 2 }, { "code": "AMD", "numeric": "051", "name": "Armenian Dram", "symbol": "դր.", "decimal": 2 }, { "code": "ANG", "numeric": "532", "name": "Netherlands Antillean Gu...

1,017 0       CURRENCY SYMBOL NUMERIC CODE REFERENCE JSON


  Let's talk about JSON.stringify()

JSON has been used in lots of places to exchange data among different services/systems. Nowadays all mainstream programming languages have built-in library support of JSON data parse and stringify. In this post, let's talk about JSON.stringify() in JavaScript.Let's first take a small example of Object conversion handling. There is a requirement to convert below objectconst todayILearn = { _id: 1, content: '今天学习 JSON.stringify(),我很开心!', created_at: 'Mon Nov 25 2019 14:03:55 GMT+0800 (中国标准时间)', updated_at...

10,946 0       JAVASCIPT JSON JSON.STRINGIFY


  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,324 0       JSON UNMARSHAL GOLANG EMPTY INTERFACE


  Empty slice vs nil slice in GoLang

In Go, there is a type called slice which is built on top of array. It's a very convenient type when we want to handle a group of data. This post will explain a subtle but tricky difference between empty slice and nil slice.A nil slice is a slice has a length and capacity of zero and has no underlying array. The zero value of slice is nil. If a slice is declared like below, it is a nil slice.package mainimport "fmt"func main() { var a []string fmt.Println(a == nil)}The output will be true for above code snippet. An empty slice is a slice also has a length and capacity of zero but has unde...

33,443 0       JSON EMPTY SLICE GOLANG NIL SLICE


  Format JSON data on Ubuntu

JSON now becomes a very popular data format because of its simplicity and light-weight. Nowadays many RESTful APIs will offer a choice of exchanging JSON data between the server and client. Sometimes the data may not be formatted and it cannot be easily read by human beings. It's frequently desired that the unformatted JSON data should be formatted before read.Today we will show a few ways to format JSON data on Ubuntu. Assume we have a json file test.json with below content.{ "title": "Test", "description": "Sample description" }The normal cat command will output below content.postman@postman...

25,602 1       UBUNTU LINUX RUBY PYTHON NODEJS PERL JSON JQ YAJL


  Cleansing data with Pig and storing JSON format to HBase with Pig UDF

IntroductionThis post will explain you the way to clean data and store JSON format to HBase. Hadoop architect experts also explain Apache Pig and its advantages in Hadoop in this post. Read more and find out how they do it.This post contains steps to do some basic clean the duplication data and convert the data to JSON format to store to HBase. Actually, we have some built-in lib to parse JSON in Pig but it is important to manipulate the JSON data in Java code before store to HBase.Apache Pig is data flow language and is built on the top of Hadoop, it helps to process, extract, loading, cleans...

8,963 3       HADOOP ARCHITECT JSON APACHE HBASE PIG UDF


  jsonSerialize() in extended class

Since PHP 5.4.0, there is a convenient interface JsonSerializable which can be used to indicate that a PHP object can be serialized to JSON object. It has only one method which should be implemented by any class which implements this interface. The method is named jsonSerialize().It's really easy to serialize an object to JSON object. Here is one example:<?phpclass ArrayValue implements JsonSerializable { public function __construct(array $array) { $this->array = $array; } public function jsonSerialize() { return $this->array; }}$array = [1, 2, 3];echo json_e...

10,123 0       JSON INHERITANCE JSONSERIALIZE EXTENDS


  JSON in JavaScript

When sending an AJAX request to the server, the response can have two formats : XMLHttpRequest.responseXML to access data with XML format and XMLHttpRequest.responseText to access data with string format. XML is the standard data transfer format, but one weakness is it's troublesome to parse and retrieve the data.JSON(JavaScript Object Notation) is a light weight data interchange format, we call it the JavaScript object representation. The advantage of using JSON as the data format is itself is JavaScript. We can first get the data from server with XMLHttpRequest.responseText and then using Ja...

5,267 0       JAVASCRIPT JSON