Skip to content

Instantly share code, notes, and snippets.

View amithkk's full-sized avatar
:octocat:
Hello There ^_^

Amith KK amithkk

:octocat:
Hello There ^_^
View GitHub Profile
@amithkk
amithkk / 01_HelloWorld.sol
Last active August 27, 2022 17:00
18 Steps to Solidity Fluency - based on Solidity By Example. Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.14+commit.80d49f37.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13; //
contract HelloWorld {
// Variable declaration <datatype> <visibility> <name> = <initial-value>
string public hello = "Hello World!";
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "../../utils/Context.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
@amithkk
amithkk / README.txt
Created June 12, 2022 16:09
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "gcc build active file",
"command": "/usr/bin/gcc",
"args": [
"-g",
"${file}",
{
"version": "0.2.0",
"configurations": [
{
"name": "(mpirun) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/usr/bin/mpirun",
"args": ["-np", "4", "${fileDirname}/${fileBasenameNoExtension}.out"],
"stopAtEntry": false,
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/lib/x86_64-linux-gnu/openmpi/include"
],
"defines": [],
"compilerPath": "/usr/bin/mpicc",
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/lib/x86_64-linux-gnu/openmpi/include"
],
"defines": [],
"compilerPath": "/usr/bin/mpicc",
"""
Yarowsky's supervised Decision List
"""
import sys
import argparse
import pprint
import string
import re
import math
@amithkk
amithkk / client.c
Created October 29, 2018 16:03
Server and Client Programs for Socket Use (TCP) with no error handling
#include <stdio.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <string.h>
int main()
{
struct sockaddr_in serv_addr; // Structure To Store Internet Address
char *msg = "Hey From Client!"; // Message we want to send
/*
3.Write a C program to convert and print a given valid parenthesized infix arithmetic expression to postfix expression.
The expression consists of single character and binary operators + - * /.
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#define STKSZ 100
struct stack { char items[STKSZ]; int top} stk;