Skip to content

Instantly share code, notes, and snippets.

View adiultra's full-sized avatar

Aditya Singh adiultra

View GitHub Profile
@adiultra
adiultra / inputInRust.md
Last active September 21, 2016 16:18
My strugle for input in rust

Difficulties

Rust is an awesome language but I was totally freaked out by its method of taking input. The code from guess the number is :

println!("Please input your guess.");

let mut guess = String::new();

io::stdin().read_line(&mut guess)
    .expect("failed to read line");
@adiultra
adiultra / xkcd.svg
Created May 30, 2016 07:11
Xkcd icon for pmxkcd
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adiultra
adiultra / file-handling-binary.md
Last active May 11, 2016 16:51
file-handling-binary doesn't work

#Binary File Handling

The following code doesn't work, please help me out.

##note

this ic TC++ not c++

Problem is with these:

@adiultra
adiultra / OOps.cpp
Created April 18, 2016 02:42
OPP.cpp
#include <iostream>
using namespace std;
class parent {
int myVar;
protected:
@adiultra
adiultra / 16bits.py
Created February 14, 2016 14:16
The python code for a 16 bit clock - alpha Preview
from datetime import datetime
import time
import os
import sys
def printer(d):
if d == 0:
print(" . . . .")
elif d == 1:
@adiultra
adiultra / numstowords.py
Created November 27, 2015 16:10
This little python code when run prints the given number in words
words = [
["", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"],
["", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "ninteen"],
["", "ten", "twenty", "thirty", "fourty", "fifty", "sixty", "seventy", "eighty", "ninty"]
]
out = ""
def triplets(num):
msg = ""
@adiultra
adiultra / logarithms.py
Created September 26, 2015 16:32
This Program/Gist is a Python script that Prints the standard table log and antilog
import math
# let us create header
hdr = 'log \t'
for hd in range(0, 10):
hdr += repr(hd) + '\t'
for hd in range(10):
hdr += repr(hd) + ' '
@rbranson
rbranson / gist:03d88e3733c6ee098a89
Last active July 25, 2017 15:17
My Thoughts on Rust

Rust is the first language that has emerged in the past few years that solves enough of my problems that it would be worth not only learning & teaching an entirely new language, but also sacrificing the maturity of the language ecosystems I’ve become accustomed to.

I highly suggest you read the "Guide" provided by the language developers or this won't make much sense. These are just some of my thoughts and are intended to highlight particular things that stand out to me. I am just a practitioner and not an expert in any of these languages, so I have probably made some incorrect assumptions and out-of-date assertions. Bare with me.

Rust feels like the first time momentum has gained behind a true systems programming language that uses modern PL design techniques to prevent common errors when dealing with memory. It seems like others have previously either been too anemic to be worth adopting or too abstract to provide proper control. The type system and assignment semantics are designed specifically to preven

Moved

Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.

Why it was moved

Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!

@Nurdok
Nurdok / python_conversion.md
Last active June 18, 2025 08:46
Python Conversion

Python Number Conversion Chart

From To Expression