Skip to content

Instantly share code, notes, and snippets.

View thelinuxpoint's full-sized avatar
🧑‍🔧
Developing

Prakash Choudhary thelinuxpoint

🧑‍🔧
Developing
  • India
  • 15:26 (UTC +05:30)
View GitHub Profile
#include <bits/stdc++.h>
using namespace std;
/* Link list Node */
struct Node {
int data;
struct Node* next;
};
// A utility function to create a new node
class Node:
# initialize a node
def __init__(self, item):
self.item = item
self.next = None
class LinkedList:
def __init__(self):
/* Creating Linked List in C++ */
#include <bits/stdc++.h>
// Node
class Node {
public:
int data;
Node* next;
Node(int data=0){
this->data = data;
}
def bubbleSort(array):
for i in range(len(array)):
# track of swapping
swapped = False
for j in range(0, len(array) - i - 1):
def selectionSort(array, size):
for step in range(size):
min_idx = step
for i in range(step + 1, size):
# to sort in descending order, change > to < in this line
# select the minimum element in each loop
//
template <class T>
int indexOfMax(T a[], int size) {
int temp = 0;
int index = 0;
for ( int i = 0; i < size; i++ ) {
if ( a[i] > temp ) {
temp = a[i];
index = i;
#![no_std]
#![no_main]
use panic_halt;
use cortex_m::asm::delay;
use cortex_m_rt::entry; // The runtime
use embedded_hal::digital::v2::OutputPin; // the `set_high/low`function
// Hardware abstract Layer
use stm32f1xx_hal::{delay::Delay, pac, prelude::*,serial::{Config, Serial}}; // STM32F1 specific functions
use stm32f1xx_hal::usb::{Peripheral, UsbBus};
@thelinuxpoint
thelinuxpoint / ext.rs
Last active July 20, 2022 19:09
Rust STM32f103c8 external interrupt demo
#![no_std]
#![no_main]
use panic_halt;
use cortex_m::asm::delay;
use cortex_m_rt::entry; // The runtime
use embedded_hal::digital::v2::OutputPin; // the `set_high/low`function
use stm32f1xx_hal::{delay::Delay, pac, prelude::*}; // STM32F1 specific functions
use stm32f1xx_hal::usb::{Peripheral, UsbBus};
[A]
2975c.v.fwmrm.net=127.0.0.1
2mdn.net=127.0.0.1
ad.doubleclick.net=127.0.0.1
ad-g.doubleclick.net=127.0.0.1
ad.mo.doubleclick.net=127.0.0.1
ads.doubleclick.net=127.0.0.1
adservice.google.com=127.0.0.1
ads.youtube.com=127.0.0.1
ad.youtube.com=127.0.0.1
#!/bin/bash
echo "Select any one interface :";
interface=""
for iface in $(ifconfig | cut -d ' ' -f1| tr ':' '\n' | awk NF)
do
interface+="$iface"
interface+=" "
done
# it splits strings using whitespace as delimeter and shows us which one to select using digits