This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.LinkedHashSet; | |
import java.util.Map; | |
import java.util.Set; | |
import java.util.Map.Entry; | |
import org.mortbay.log.Log; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="application/ld+json"> | |
{ | |
"@context": "http://schema.org", | |
"@type": "BlogPosting", | |
"headline": "部落格文章標題", | |
"image": "該文章主圖", | |
"editor": "部落客名稱", | |
"publisher": "部落格名稱", | |
"url": "文章網址", | |
"datePublished": "文章發布時間,格式如右: 2015-09-20", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="application/ld+json"> | |
{ | |
"@context":"http://schema.org", | |
"@type":"DiscussionForumPosting", | |
"@id":"討論區文章網址", | |
"headline":"討論區文章標題", | |
"author": { | |
"@type": "Person", | |
"name": "發文者名稱" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="application/ld+json"> | |
{ | |
"@context": "http://schema.org", | |
"@type": "Product", | |
"name": "評鑑商品名稱", | |
"description": "", | |
"url": "評鑑商品網址", | |
"image": "評鑑商品圖片網址", | |
"offers": { | |
"@type": "Offer", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
contract Test { | |
enum Period { | |
AM, PM | |
} | |
struct Student { | |
uint no; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
contract MappingTypeDemo { | |
enum Period { | |
AM, PM | |
} | |
struct Student { | |
uint no; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
contract MappingTypeDemo { | |
mapping(bool => int) map; | |
// mapping 不能是 local variable | |
function mappingInLocalVariable() external view { | |
// mapping(bool => int) memory map; // 打開此行會報錯 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
contract MappingDemo { | |
mapping(string => uint8) scoreMap; | |
function setScore(string memory name, uint8 score) external { | |
scoreMap[name] = score; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
contract ArrayTypeDemo { | |
// two way to declare fixed length array | |
uint[5] fixedLengthArray1; | |
uint[] fixedLengthArray2 = [1, 2, 3]; | |
// declare dynamic length array |
OlderNewer