Skip to content

Instantly share code, notes, and snippets.

View Adwaith-Rajesh's full-sized avatar
:octocat:
Coding for fun.

Adwaith Rajesh Adwaith-Rajesh

:octocat:
Coding for fun.
View GitHub Profile
@Adwaith-Rajesh
Adwaith-Rajesh / poly_addn_ll.zig
Created April 1, 2023 19:14
polynomial addition in zig using linked list
const std = @import("std");
const stdout = std.io.getStdOut().writer();
const Term = struct {
coef: f32,
exp: i32,
next: ?*Term = null,
};
const Polynomial = struct {
@Adwaith-Rajesh
Adwaith-Rajesh / polynomial_addition.zig
Created March 29, 2023 15:54
Adding two polynomials in zig using arrays
const std = @import("std");
const stdout = std.io.getStdOut().writer();
const stdin = std.io.getStdIn().reader();
const stderr = std.io.getStdErr().writer();
const expect = std.testing.expect;
const exit = std.os.exit;
const Term = struct {
coef: f32,
exp: i32,
@Adwaith-Rajesh
Adwaith-Rajesh / backtracking_template.py
Created October 29, 2021 05:43 — forked from RuolinZheng08/backtracking_template.py
[Algo] Backtracking Template & N-Queens Solution
def is_valid_state(state):
# check if it is a valid solution
return True
def get_candidates(state):
return []
def search(state, solutions):
if is_valid_state(state):
solutions.append(state.copy())
@Adwaith-Rajesh
Adwaith-Rajesh / file.md
Created June 11, 2021 14:18
Issues with activating a virtual env from a python file.

Spoiler alert, you cannot activate a venv from a python file.

Through out this post we will discuss on how venv works, why you cannot activate a venv from python.

How does a venv work or gets activated.

Let's first go through a code snippet here.

@echo off