Skip to content

Instantly share code, notes, and snippets.

View bistcuite's full-sized avatar
🏠
Working

Hasan K. bistcuite

🏠
Working
View GitHub Profile
@bistcuite
bistcuite / main2.cpp
Created December 19, 2023 16:13
cpp star rectangle pattern
#include <stdio.h>
#include <windows.h>
#include <stdlib.h>
void gotoxy(int x, int y)
{
COORD c;
c.X = x - 1;
c.Y = y - 1;
SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c);
}
@bistcuite
bistcuite / main.cpp
Created December 19, 2023 16:12
unfinished star pattern project
#include <iostream>
#include <conio.h>
#include <windows.h>
#include <cstdlib>
using namespace std;
// going to (x,y) in terminal windows
void gotoxy(short int x, short int y)
{
from timeit import timeit
my_list = list(range(10000))
print("Reverse benchmark in a big list :")
print("reverse_slice: ",timeit(lambda: my_list[::-1],number=10000))
print("reverse_in_place: ",timeit(lambda: my_list.reverse(),number=10000))
my_list2 = [1,2,3,4]
def tokenizer(input_program):
# A `current` variable for tracking our position in the code like a cursor.
current = 0
# And a `tokens` array for pushing our tokens to.
tokens = []
#* this is a little optimization, since `input_program` length won't change
# in the excecution it is safe to get the length at the beginning.
program_length = len(input_program)
#!/usr/bin/env python
# This is an example Git server. http://blog.nerds.kr/post/106956608369/implementing-a-git-http-server-in-python
# Stewart Park <stewartpark92@gmail.com>
from flask import Flask, make_response, request, abort
from StringIO import StringIO
from dulwich.pack import PackStreamReader
import subprocess, os.path
from flask.ext.httpauth import HTTPBasicAuth