此僅為備份,因為原文在Facebook中。 作者:顏華容 https://www.facebook.com/artemis.yen/posts/10207549044542275
一點關於練琴效率的小心得 如果大家有興趣的話,在連假的這幾天可以實驗
實驗材料:沒有彈過的曲子(有沒有聽過無妨,因為聽過你也不見得會彈,哈哈。)
-- method 1 | |
maxi :: (Ord a) => [a] -> a | |
maxi [] = error "Empty list." | |
maxi [x] = x | |
maxi (x:xs) | |
| x > maxTail = x | |
| otherwise = maxTail | |
where maxTail = maxi xs | |
-- method 2 |
quicksort :: (Ord a) => [a] -> [a] | |
quicksort [] = [] | |
quicksort (x:xs) = | |
let smallerSorted = quicksort [a | a <- xs, a <= x] | |
largerSorted = quicksort [a | a <- xs, a > x] | |
in smallerSorted ++ [x] ++ largerSorted |
# How to Reload Tmux Config: | |
# | |
# This can be done either from within tmux, by pressing Ctrl+B and then : to bring up a command prompt, and typing: | |
# | |
# :source-file ~/.tmux.conf | |
# | |
# Or simply from a shell: | |
# | |
# $ tmux source-file ~/.tmux.conf |
(defun rep-elt (list &optional n new) | |
(cond ((null n) | |
list) | |
((> n 0) | |
(cons (car list) (rep-elt (cdr list) (1- n) new))) | |
((eq n 0) | |
(cons new (cdr list)) | |
))) |
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document domain("www.gnu.org") { | |
code, kbd { | |
border-radius: 2px; | |
padding:1px 10px; | |
} | |
code{ | |
color: #006 !important; | |
background-color: #ddf !important; | |
} |
class ProductCreate(StaffuserRequiredMixin, CreateView): | |
''' | |
Use URL parameter (GET) to decide if currently is under a category | |
''' | |
form_class = ProductForm | |
template_name = 'console/create_product.html' | |
submit_title = "建立商品" | |
def get_context_data(self, *args, **kwargs): | |
context = CreateView.get_context_data(self, *args, **kwargs) |
{# accounts/includes/login.html #} | |
{% load crispy_forms_tags %} | |
<h1>Login</h1> | |
<div class="col-sm-12"> | |
<form class="login-form" method="post"> | |
{% csrf_token %} | |
{{ form|crispy }} | |
<button type="submit" class="btn btn-primary">Login!!!!!</button> | |
</form> | |
</div> |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import hashlib, os, sys, math, threading, time, argparse, datetime, sqlite3 | |
# filePath is relative path | |
# list.append() set.add() | |
class Hasher(threading.Thread): | |
def __init__(self, lock, file_walker): | |
threading.Thread.__init__(self) |
Site Configuration | |
site_title: ________________ | |
site_subtitle: _________________ | |
admin_email: _________________ | |
admin_phone: _________________ | |
[Save] |
此僅為備份,因為原文在Facebook中。 作者:顏華容 https://www.facebook.com/artemis.yen/posts/10207549044542275
一點關於練琴效率的小心得 如果大家有興趣的話,在連假的這幾天可以實驗
實驗材料:沒有彈過的曲子(有沒有聽過無妨,因為聽過你也不見得會彈,哈哈。)