Skip to content

Instantly share code, notes, and snippets.

View Vib-UX's full-sized avatar
🏠
Working from home

Vibhav Sharma Vib-UX

🏠
Working from home
View GitHub Profile
@Vib-UX
Vib-UX / Encoding.sol
Created December 25, 2024 13:31
Advanced EVM - Encoding
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
// For the cheatsheet, check out the docs: https://docs.soliditylang.org/en/v0.8.13/cheatsheet.html?highlight=encodewithsignature
contract Encoding {
function combineStrings() public pure returns (string memory) {
return string(abi.encodePacked("Hi Mom! ", "Miss you."));
}
@Vib-UX
Vib-UX / keybase.md
Created July 29, 2022 10:31
Keybase

Keybase proof

I hereby claim:

  • I am vib-ux on github.
  • I am predator_757 (https://keybase.io/predator_757) on keybase.
  • I have a public key ASAbznjhxhLlcD7RSYEHTWoiQHi8oVWMur-tbhVUlSupGwo

To claim this, I am signing this object:

#Creating a matrix with random float values
#First we are specifying the range ie our values will range from -1 to 10
#Secondly we are specifying the size of the array
arr=np.random.uniform(-1,10,size=(4,4))
print(arr)
#Creating an array of dimensions 3x4 with all values set to zero
arr0=np.zeros((3,4))
print(arr0)
#Creating an array of dimensions 1x2 with all values set to one
arr1=np.ones((1,2))
print(arr1)
#Creating an identity 2d matrix
arr=np.identity(2)
arr = np.array([[1,2,3,4,5], [6,7,8,9,10]])
#Getting specific row
print(arr)
#Getting all the elements of first row
print(arr[0,:])
#Getting all the elements of 2nd column
print(arr[:,1])
arr1=np.array([1,2,3,4,5],dtype='int16')
print(arr1.dtype)
arr2=np.array([1,2,3,4,5],dtype='int32')
print(arr2.dtype)
arr3=np.array([1,2,3,4,5],dtype='int64')
print(arr3.dtype)
#Checking the Array Shape
print('Shape:' ,arr3.shape)
#Checking the Array Dimension
print('Array dimension: ',arr3.ndim)
#Checking the Array Data type
print('Array DataType: ',arr3.dtype)
#Checking the Array total size(in bytes)
@Vib-UX
Vib-UX / Vibhav_NumPy_2.py
Created December 30, 2020 14:23
NumPy_py
#Creating a 2D array
arr2=np.array([[1,2,3,4],[5,6,7,8]])
#Creating a 3D array
arr3=np.array([[[1,2,3],[3,4,5],[5,6,7]]])
print(arr2)
print(arr3)
@Vib-UX
Vib-UX / Vibhav_NumPy.py
Last active December 30, 2020 14:20
Starting with NumPy
#Importing Numpy and creating a numpy darray object
import numpy as np
arr1=np.array([100,200,400,500])
print(arr1)