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
// Myanmar Phone Number validation & normalization for ES6 | |
// Based on https://github.com/trhura/mm_phonenumber | |
const mobileCode = "(0?9)"; | |
const countryCode = "(\\+?95)"; | |
const ooredooNumber = "(?:9(?:7|6)\\d{7})"; | |
const telenorNumber = "(?:7(?:9|8|7|6)\\d{7})"; | |
const mptNumber = | |
"(?:5\\d{6}|4\\d{7,8}|2\\d{6,8}|3\\d{7,8}|6\\d{6}|8\\d{6}|7\\d{7}|9(?:0|1|9)\\d{5,6})"; | |
const allOperators = `(${ooredooNumber}|${telenorNumber}|${mptNumber})$`; |
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
(define (border-flag filename) | |
(let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) | |
(drawable (car (gimp-image-get-active-layer image)))) | |
(gimp-proc-db-call "script-fu-double-border" | |
RUN-NONINTERACTIVE | |
image | |
drawable | |
'(238 238 238) | |
7 |
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
#! /usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
def get_ipa (syllable): | |
ipa = '' | |
consonant = syllable[0] | |
i = 1 | |
while i < len(syllable) and syllable[i] in ['\u103B', '\u103C','\u103D','\u103E']: | |
i += 1 | |
medial = syllable[1:i] |
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
#! /usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
def get_ipa (syllable): | |
ipa = '' | |
ipa += get_cons_ipa(syllable) | |
ipa += get_medial_ipa(syllable) | |
ipa += get_vowel_ipa (syllable) | |
if u"\u028A" in ipa: |
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
<?php | |
/* Zawgyi<>Unicode converter python module */ | |
/* Based on rules from Parabaik Myanmar Text Converter */ | |
/* Copyright (C) 2014 Ngwe Tun (Solveware Solution) */ | |
/* Copyright (C) 2014 Thura Hlaing */ | |
/* This file is part of Paytan. */ | |
/* Paytan is free software: you can redistribute it and/or modify */ |
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
// Zawgyi<>Unicode converter python module | |
// Based on rules from Parabaik Myanmar Text Converter | |
// Copyright (C) 2014 Ngwe Tun (Solveware Solution) | |
// Copyright (C) 2014 Ye Mon Kyaw | |
// This file is part of Paytan. | |
// Paytan is free software: you can redistribute it and/or modify | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation, either version 3 of the License, or |
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
-module (calculator). | |
-export ([exponential/2, multiply/2]). | |
multiply(_, 0) -> 1; | |
multiply(Num, 1) -> Num; | |
multiply(Num, Exp) -> Num + multiply(Num, Exp-1). | |
exponential(_, 0) -> 1; | |
exponential(Base, 1) -> Base; | |
exponential(_, Exp) when(Exp < 0) -> throw("Bad argument"); |
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
def multiply(a, b): | |
# Assuming a and b are not negative | |
if b == 0: return 0 | |
if b == 1: return a | |
return a + multiply(a, b-1) | |
def power(b, e): | |
# Assuming e is not negative | |
if e == 0: return 1 | |
if e == 1: return b |
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
-- Assuming a and b are not negative | |
multiply a 0 = 0 | |
multiply a 1 = a | |
multiply a b = a + multiply a (b-1) | |
-- Assuming e is not negative | |
power b 0 = 1 | |
power b 1 = b | |
power b e = multiply b $ power b (e-1) -- aka multiply b (power b e-1) |
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
#! /usr/bin/env python2 | |
import cv2 | |
import numpy as np | |
colors = [] | |
def on_mouse_click (event, x, y, flags, frame): | |
if event == cv2.EVENT_LBUTTONUP: | |
colors.append(frame[y,x].tolist()) |
NewerOlder