Skip to content

Instantly share code, notes, and snippets.

View anurag3301's full-sized avatar
🐧
Lets Make Something

Anurag Kumar Singh anurag3301

🐧
Lets Make Something
View GitHub Profile

Question 21

file = open("gallon.txt", "r")

for i in file:
    speed = float(i.strip())
    print(f"{speed}kmph -> {speed * 0.62}mph")

file.close()

std::unique_ptr<>

Ways to create unique_ptr

#include <iostream>
#include <memory>

class MyClass {
public:
    int obj_id;

Template in cpp

C++ templates are a powerful feature of the C++ programming language that allow for generic programming. They provide a way to write code that can work with different data types or operate on different data structures without sacrificing type safety.

Summary: Stroustrup originally used class to specify types in templates to avoid introducing a new keyword. Some in the committee worried that this overloading of the keyword led to confusion. Later, the committee introduced a new keyword typename to resolve syntactic ambiguity, and decided to let it also be used to specify template types to reduce confusion, but for backward compatibility, class kept its overloaded meaning.

Funtion Template

#include <iostream>

Hey Sarah, Yeah I had to increase the price a little bit due to the cut, But its going above your budget, no problem, If you are willing go off platform and pay me directly, I easily bring the price down to 3EUR/h no need of the whole package stuff.

If you wanna stay on the platfrom then I can propose a special pack but you'll have pay the full 5EUR/hr * 10 = 50 EUR, I cant make it flexible.

But if are not able to pay, no worries, I can help you for free.

So if you willing to go off platform, you can message me any of the following place

contact: 
 email : anurag3301.0x0@gmail.com
-- Dashboard config
local plugins_count = vim.fn.len(
vim.fn.globpath('~/.local/share/nvim/site/pack/packer/start', '*', 0, 1)
)
local dashboard_height = 27
-- db.header_pad = math.floor((vim.api.nvim_list_uis()[1]['height'] - dashboard_height) / 4)
require('dashboard').setup{
theme = 'doom',

Post secure server configuration

Adding a new user

Just ssh with your root account

ssh root@<ip>

Add a new user which you'll use to ssh

# Creater the new user
@anurag3301
anurag3301 / setup.md
Last active January 22, 2023 10:02
A guild to setup the VPS with display and kali linux docker

A guild to setup the VPS with display and kali linux docker

Windows setup

Install and setup terminal with ssh

First go to the Microsoft Store and install Windows Terminal

Run the Windows Terminal with administrator previledges and run following command to start the ssh agent service

Get-Service -Name ssh-agent | Set-Service -StartupType Automatic

Contents

BaumKnoten

This file consist of class for tree node and also responsible for doing all the tree operation, the class declaration is as follow, It consist of private and public block, the private members are the data, right node pointer and left node pointer

class BaumKnoten{
private:
 int wert;
@anurag3301
anurag3301 / bst.md
Created December 7, 2022 03:14
Binary Search tree

The .h file

The program start with declaring a namespace suchbaum which is gonna hold a strcut which is a node with data value, pointer to right node and pointer to left node

It has 3 functions, the insert function to insert a new node to the binary search tree, Two function ausgeben and knoten_ausgeben who are responsible to print the tree.

namespace suchbaum{
    struct BaumKnoten{
        int wert;
        BaumKnoten *links;
        BaumKnoten *rechts ;

HackerRank Questions

Contest Creator anurag3301

Contents:

  1. Table (Easy)
  2. Classic FizzBuzz (Easy)
  3. Classic Fibonacci (Easy)
  4. Sparse Matrix (Easy)
  5. Char Count (Intermediate)
  6. Sum Digit Count (Intermediate)