Skip to content

Instantly share code, notes, and snippets.

View sanjibnarzary's full-sized avatar

Sanjib Narzary sanjibnarzary

View GitHub Profile
@sanjibnarzary
sanjibnarzary / addition.asm
Created January 10, 2012 14:03
Adding Two Numbers and Display the Content of Register in Assembly Language using nasm
;Author : Sanjib Narzary
;Institute: NIT Calicut
;Email: o-._.-o@live.com
;Assembly Code
section .text
global main
extern printf
main:
@sanjibnarzary
sanjibnarzary / loop.asm
Created January 11, 2012 06:59
Lets count 10 to 0 in Assembly Language (Assenbly Language program to loop 10 times)
;Author : Sanjib Narzary
;Institute: NIT Calicut
;Email: o-._.-o@live.com
;Assembly Code
section .text
global main
extern printf
main:
mov ebx,10 ;number 10 to ebx
@sanjibnarzary
sanjibnarzary / cio.asm
Created January 11, 2012 12:53
Character Input Output in ASM using NASM in UBUNTU Linux
;Author : Sanjib Narzary
;Institute: NIT Calicut
;Email: o-._.-o@live.com
;Assembly Code
section .data
;New line string
NEWLINE: db 0xa, 0xd
LENGTH: equ $-NEWLINE
section .bss
INPT: resd 1
@sanjibnarzary
sanjibnarzary / greet.asm
Created January 11, 2012 14:05
Prompt a User to type his name and Gree Him on the Console, Assembly Language Code
;Author : Sanjib Narzary
;Institute: NIT Calicut
;Email: o-._.-o@live.com
;greet.asm
section .data
; Declare/store the information "Hello World!"
prompt db 'What is your name? '
; do not change the order of the following three lines!
helloMsg dq 'Hello '
name db ' ' ; space characters
@sanjibnarzary
sanjibnarzary / stackoverflow.sql
Created February 15, 2016 15:54 — forked from gousiosg/stackoverflow.sql
Script to import the stackexchange dumps into MySQL
# Copyright (c) 2013 Georgios Gousios
# MIT-licensed
create database stackoverflow DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
use stackoverflow;
create table badges (
Id INT NOT NULL PRIMARY KEY,
UserId INT,
void main(){
print("Hello World");
Student s = new Student(23,"Sanjib Narzary","G1234");
print(s.roll);
}
class Student{
int age;
String name;
String rollNumber;
import tensorflow.keras
from PIL import Image, ImageOps
import numpy as np
# Disable scientific notation for clarity
np.set_printoptions(suppress=True)
# Load the model
model = tensorflow.keras.models.load_model('keras_model.h5')
@sanjibnarzary
sanjibnarzary / .deps...npm...@openzeppelin...contracts...access...AccessControl.sol
Created May 19, 2021 16:59
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.0+commit.c7dfd78e.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
@sanjibnarzary
sanjibnarzary / test.sh
Last active September 8, 2023 16:28
Testing a fairseq Translation Model
#!/usr/bin/env bash
#
# Adapted from https://github.com/facebookresearch/MIXER/blob/master/prepareData.sh
usage() {
echo "usage: <command> options:<e|p|b|a>"
echo "-e exp1 -p eng-brx -b 5000 -a transformer"
}
no_args="true"
while getopts e:l:b:a: flag; do
case "${flag}" in
@sanjibnarzary
sanjibnarzary / test.py
Last active September 8, 2023 16:27
Testing script in Python fairseq machine translation model
import sys
if len(sys.argv) <3:
print("python test.py checkpoint_path data-bin bpe_code")
sys.exit(0)
else:
path=sys.argv[1]
db=sys.argv[2]
code=sys.argv[3]
from fairseq.models.transformer import TransformerModel
eng2brx = TransformerModel.from_pretrained(