Skip to content

Instantly share code, notes, and snippets.

@kuoe0
kuoe0 / divisible-by-3-division.py
Created December 14, 2013 12:32
check integer is divisible by 3 using division operation
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2013 KuoE0 <kuoe0.tw@gmail.com>
#
# Distributed under terms of the MIT license.
"""
#! /usr/bin/env python
#coding=utf-8
import pty
import os
import select
def mkpty():
#
@kuoe0
kuoe0 / divisible-by-3-hex.py
Created December 14, 2013 12:34
check integer divisible by 3 using hex
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2013 KuoE0 <kuoe0.tw@gmail.com>
#
# Distributed under terms of the MIT license.
"""
@kuoe0
kuoe0 / divisible-by-3-string.py
Created December 14, 2013 12:33
check integer divisible by 3 using string conversion
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2013 KuoE0 <kuoe0.tw@gmail.com>
#
# Distributed under terms of the MIT license.
"""
@kuoe0
kuoe0 / divisible-by-3-alt-sum.py
Created December 14, 2013 12:35
check integer divisible by 3 using alternative sum
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2013 KuoE0 <kuoe0.tw@gmail.com>
#
# Distributed under terms of the MIT license.
"""
@kuoe0
kuoe0 / divisible-by-3-fsm.y
Created December 14, 2013 12:35
check integer divisible by 3 using finite state machine
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2013 KuoE0 <kuoe0.tw@gmail.com>
#
# Distributed under terms of the MIT license.
"""
@kuoe0
kuoe0 / EFI_Snake.c
Created September 28, 2013 08:33
http://bbs.csdn.net/topics/320147085 在 EFI 下完貪食蛇...
#include "efi.h"
#include "efilib.h"
#include "she.h"
#include <atk_libc.h>
#include <stdio.h>
#include <stdlib.h>
#include "Bmp.h"
#include "Hii.h"
#!/usr/bin/env sbcl --script
;;; load quicklisp
(load "~/.quicklisp/setup.lisp")
;;; load package and redirect the loading msg to /dev/null
(with-open-file (*standard-output* "/dev/null" :direction
:output :if-exists :supersede)
(ql:quickload '("drakma" "com.informatimago.common-lisp.html-parser")))
;;; get html tag name
(defun html-tag (xml)
@kuoe0
kuoe0 / Install_OpenSSL_APT.sh
Created September 23, 2013 18:18
編譯採用 OpenSSL 的 APT,避免某些網路環境下發生 gnutls_handshake() failed 的情況!
#!/usr/bin/env bash
# =============================================================================
# FileName: Install_OpenSSL_APT.sh
# Desc: Build APT with OpenSSL and Install it
# Environment: Ubuntu 13.04 amd64
# Usage: ./Install_OpenSSL_APT.sh
# Author: KuoE0 <kuoe0.tw@gmail.com>
# HomePage: http://kuoe0.tw/
# Copyright: BSD License (C) 2013 KuoE0
# =============================================================================
<script type="text/javascript">
var interval = 25;
var myTimer;
var isTick = false;
var h = getDocHeight() * 0.6;
//console.log(h);
var count = 0;