Become a member
Sign in
Darong Mean
Darong Mean

Darong Mean

63 Following
16 Followers
·
  • Profile
  • Claps
  • Highlights

Latest

Darong Mean
Darong Mean
Nov 26, 2017 · 1 min read

Sum Type/Union Type

In Java

Use abstract class. http://stackoverflow.com/questions/9975836/howto-simulate-haskells-either-a-b-in-java

In Clojure

Use vector. [:left …] and [:right ..] to model either type. U can pattern match on first…

Darong Mean
Darong Mean
Nov 26, 2017 · 1 min read

Naming conversion

as…

for explicit coercion method

Ex: as.numeric(x)

…?

for condition method. use is… or has… if the programming langauge doesn’t allow ? character.

Darong Mean
Darong Mean
Nov 26, 2017 · 2 min read

html anchor <a>

target attribute

http://stackoverflow.com/a/8867079

Using target=”_blank” will instruct the browser to create a new browser tab or window when the user clicks on the link.

Darong Mean
Darong Mean
Jan 2, 2015 · 1 min read

Deal with Liferay Friendly URL Mapping

Liferay has default url start with /web, /group and /user to identify if the page is public, private, or user’s private. The mappings can be changed by modify file portal-ext.properties and ROOT/WEB-INF/web.xml.

Darong Mean
Darong Mean
Dec 1, 2014 · 1 min read

401 vs 403

401 “Unauthorized” really means unauthenticated. You need valid credentials for me to respond to this request.

403 “Forbidden” really means unauthorized. I understand your credentials, but sorry, you’re not allowed.

source https://www.youtube.com/watch?feature=player_detailpage&v=FeSdFhsKGG0#t=394