- Optional/nullable data types.
- Variant data types.
- Flag with extra information needed only in some cases (or different in different cases).
- Modeling states in a state machine where each state can have some data associated with it.
- List of operations for batch processing, where each operation can have its own arguments.
- Alternative to function overloading that allows avoiding combinatorial explosion when there are multiple parameters that need variants.
- Nested data structures with heterogenous nodes.
This file contains 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 CryptoJS from 'crypto-js'; | |
import './app.css'; | |
import FileInput from "./components/FileInput/FileInput"; | |
import { FC, useEffect, useState } from "react"; | |
const getAESEncrypted = (secret: string, password: string) => { | |
const encrypted = CryptoJS.AES.encrypt(secret, password); | |
return encrypted.toString(); | |
} |
This file contains 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> | |
import Web3 from 'web3' | |
export default ({ | |
data() { | |
return { | |
buttonDisabled: false, | |
buttonInstallText: "Click here to install Metamask", | |
} | |
}, |
This file contains 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
// Prepare a simple Markdown example | |
var code = "### Hello World" + | |
"\r\n" + | |
"[visit applications](https://.aspose.com)"; | |
// Create a Markdown file | |
System.IO.File.WriteAllText(dataDir + "document.md", code); | |
// Convert Markdown to HTML document | |
using (HTMLDocument document = Aspose.Html.Converters.Converter.ConvertMarkdown(dataDir + "document.md")) | |
{ |
This file contains 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
// ----------------------------------------------------------------------------- | |
// Deps | |
// ----------------------------------------------------------------------------- | |
const fromCWD = require('from-cwd'); | |
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); | |
const PnpWebpackPlugin = require('pnp-webpack-plugin'); | |
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants'); | |
// ----------------------------------------------------------------------------- |
This file contains 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
contract Database{ | |
mapping(uint => uint) public _data; | |
mapping(address => bool) _owners; | |
function Database(address[] owners){ //Called once at creation, pass in initial owners | |
for(uint i; i<owners.length; i++){ | |
_owners[owners[i]]=true; | |
} | |
} | |