Skip to content

Instantly share code, notes, and snippets.

@AungWinnHtut
AungWinnHtut / Binary Search Tree.cpp
Created February 18, 2019 05:14 — forked from harish-r/Binary Search Tree.cpp
Binary Search Tree Implementation in C++
#include<iostream>
using namespace std;
class BST
{
struct node
{
int data;
node* left;
@AungWinnHtut
AungWinnHtut / BST_InorderSuccessor_CPP.cpp
Created February 18, 2019 05:13 — forked from mycodeschool/BST_InorderSuccessor_CPP.cpp
C++ program to find Inorder successor in a BST
/* C++ program to find Inorder successor in a BST */
#include<iostream>
using namespace std;
struct Node {
int data;
struct Node *left;
struct Node *right;
};
//Function to find some data in the tree
/*
ADXL335
note:vcc-->5v ,but ADXL335 Vs is 3.3V
The circuit:
5V: VCC
analog 1: x-axis
analog 2: y-axis
analog 3: z-axis
*/
const int xpin = 1; // x-axis of the accelerometer
#include <SoftwareSerial.h>
SoftwareSerial WinHtutBT(7, 6);
int i = 0;
void setup() {
Serial.begin(9600);
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
@AungWinnHtut
AungWinnHtut / mmwrap.html
Created June 18, 2016 12:30 — forked from eimg/mmwrap.html
Inserting ZWSP between every syllables for better text wrapping for Myanmar text.
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Break Wrap</title>
<style>
body {
background: #efefdd;
}
@AungWinnHtut
AungWinnHtut / mmstrlen.php
Created June 18, 2016 12:30 — forked from eimg/mmstrlen.php
Count no. of syllabes in a Myanmar Unicode string.
<?php
function mmstrlen($str) {
$standalones = array("ဤ", "၍", "ဪ", "၏", "၊", "။", "၌");
$consonants = array("က", "ခ", "ဂ", "ဃ", "င", "စ", "ဆ", "ဇ", "ဈ", "ည", "ဍ", "ဌ", "ဋ", "ဎ", "ဏ", "တ", "ထ", "ဒ", "ဓ", "န", "ပ", "ဖ", "ဗ", "ဘ", "မ", "ယ", "ရ", "လ", "ဝ", "သ", "ဟ", "ဠ", "အ");
$numbers = array("၀", "၁", "၂", "၃", "၄", "၅", "၆", "၇", "၈", "၉");
$len = mb_strlen($str, "UTF-8");
$count = 0;
for($i = 0; $i < $len; $i++) {
@AungWinnHtut
AungWinnHtut / adb+
Created February 11, 2016 10:30 — forked from christopherperry/adb+
A bash script that let's you issue adb commands to multiple devices at once
#!/bin/bash
# Script adb+
# Usage
# You can run any command adb provides on all your currently connected devices
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command>
#
# Examples
# ./adb+ version
# ./adb+ install apidemo.apk
# ./adb+ uninstall com.example.android.apis
@AungWinnHtut
AungWinnHtut / ADB+.BAT
Created February 11, 2016 10:29 — forked from thebagchi/ADB+.BAT
script for issuing commands to multiple android devices on windows
:: Inspired by Linux version of the same https://gist.github.com/christopherperry/3208109
@echo off
SET ARGUMENTS=%~1
if "%ARGUMENTS%" == "" (
GOTO EOF
)
SET "ARGUMENTS=%ARGUMENTS:""="%"
@AungWinnHtut
AungWinnHtut / password_animation.py
Created December 30, 2015 04:31 — forked from the-c0d3r/password_animation.py
Movie-like password cracking animation in Python that looks nifty. Code for guessing a string written for a problem in "Problem Solving with Algorithms and Data Structures" with my additional idea of printing every attempt and slowing down prints to make them readable.
import random
import time
import sys
import string
def generate_random_guess(chars):
return random.choice(chars)
def repeated_guesses(target):