This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from peewee import MySQLDatabase, fn | |
from typing import (Optional, List) | |
import models | |
import bcrypt | |
from models import (OfflineRegAdmin, User, Hospitality, OfflineReg) | |
database = MySQLDatabase('nitcfest_test', | |
**{'charset': 'utf8', 'use_unicode': True, | |
'host': 'tathva.org', | |
'port': 3306, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text | |
# S0 = 0xb8000 | |
lui $s0, 0xb; | |
ori $s0, $s0, 0x8000 | |
# S1 = 3937, ASCII codepoint: 'a', FG: white, BG: black, Blink: 0 | |
ori $s1, $zero, 3937 | |
# RAM[0xb8000] = 3937 | |
sw $s1, 0($s0) | |
# infinite loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern fputs | |
extern stdout | |
section .data | |
hw: db "Hello World!", 10, 0 | |
section .text | |
global main | |
main: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
def __init__(self, value, left=None, right=None): | |
self.value = value | |
self.left = left | |
self.right = right | |
def successor(node, x): | |
""" Return smallest node greater than x, if it exists, | |
in the subtree rooted at given node """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use chrono; | |
fn main() { | |
loop { | |
println!("The time is {}", chrono::Local::now().naive_local().format("%H:%M")); | |
std::thread::sleep_ms(1000); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use nix::fcntl; | |
use nix::sys::select; | |
use std::io::Read; | |
use std::os::unix::io::AsRawFd; | |
use std::process; | |
fn main() { | |
let mut path = std::env::current_exe().unwrap(); | |
path.set_file_name("teller"); | |
let mut proc = process::Command::new(&path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::Read; | |
use std::process; | |
fn main() { | |
let cmdline_args: Vec<String> = std::env::args().collect(); | |
let mut path = std::path::Path::new(&cmdline_args[1]).to_path_buf(); | |
let args = &cmdline_args[2..]; | |
let mut proc = process::Command::new(&path) | |
.args(args) | |
.stdout(process::Stdio::piped()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
char buf[1024]; | |
int main() | |
{ | |
printf("Hello: \n"); | |
while (1) | |
{ | |
// If I comment this line, reader works as expected. | |
fgets(buf, 10, stdin); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name of display: :0 | |
display: :0 screen: 0 | |
direct rendering: Yes | |
server glx vendor string: SGI | |
server glx version string: 1.4 | |
server glx extensions: | |
GLX_ARB_create_context, GLX_ARB_create_context_no_error, | |
GLX_ARB_create_context_profile, GLX_ARB_create_context_robustness, | |
GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample, | |
GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cabal v2-install vty | |
Wrote tarball sdist to | |
/home/farzeen/Projects/CHIP8_Haskell/dist-newstyle/sdist/CHIP8-Haskell-0.1.0.0.tar.gz | |
Resolving dependencies... | |
Build profile: -w ghc-8.6.5 -O1 | |
In order, the following will be built (use -v for more details): | |
- microlens-mtl-0.2.0.1 (lib) (requires build) | |
- vty-5.26 (lib) (requires build) | |
- vty-5.26 (exe:vty-demo) (requires build) | |
- vty-5.26 (exe:vty-mode-demo) (requires build) |
OlderNewer