
IT Blog
- November 2022 (1)
- August 2022 (1)
- July 2022 (1)
- June 2022 (2)
- May 2022 (1)
- January 2022 (3)
- July 2021 (1)
- June 2021 (1)
- December 2020 (2)
- November 2020 (2)
- October 2020 (1)
- August 2020 (2)
- July 2020 (2)
- June 2020 (3)
- May 2020 (3)
Follow My Blog
Get new content delivered directly to your inbox.
- Using the OpenAI API in a C# console applicationRepo: https://github.com/kaajoj/OpenAIApp To run it, you need to provide your own API key. Sample code with request to generate new image: https://github.com/kaajoj/OpenAIApp/blob/cc1881a985365683c90484e9cb2dca7c1361b810/OpenAIApp/OpenAI.cs#L52 Sample results ofContinue reading “Using the OpenAI API in a C# console application”
- New console template – use user secretdotnet user-secrets init set a secret: dotnet user-secrets set “API_KEY” “test123” use UserSecretsId (from .csproj file) in AddUserSecrets()
- Truffle test – ReferenceError: accounts is not definedWhen you run command ‘truffle test’ and get error:“ReferenceError: accounts is not defined” To fix this, use below code line:contract(“Contract”, async (accounts) => {} andContinue reading “Truffle test – ReferenceError: accounts is not defined”
- Error: Number can only safely store up to 53 bitsI got this error: ‘Error: Number can only safely store up to 53 bits’ when using toNumber function: Quick fix using BigInt:
- Truffle test – network errortruffle(ganache)> truffle testError: You must specify a network_id in your ‘ganache’ configuration in order to use this network. Go to config file: truffle-config.js -> uncommentContinue reading “Truffle test – network error”
- Create new ERC20 token – smart contractSample smart contract to create your own token: The same code, but with a hard-coded name, symbol and initial supply: Sources:https://docs.openzeppelin.com/contracts/4.x/erc20https://solidity-by-example.org/app/erc20/https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.0.0/contracts/token/ERC20/ERC20.sol