This file contains hidden or 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
| Single var Pattern | |
| ======================= | |
| function fun() { | |
| var a = 1, | |
| b = 2, | |
| sum = a + b, | |
| myobject = {}, | |
| i, | |
| j; |
This file contains hidden or 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
| ;; ex1.2 | |
| (/ (+ 5 4 (- 2 (- 3 (+ 6 (/ 4 5))))) (* 3 (- 6 2) (- 2 7))) |
This file contains hidden or 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
| (defun print-tag (name alst closingp) | |
| (princ #\<);;1 print an opening angle | |
| (when closingp;;2 check the predicate closingp | |
| (princ #\/)) | |
| (princ (string-downcase name)) ;;3 converting lower-case | |
| (mapc (lambda (att) ;;4 iterate through all the attributes in the alist of attr | |
| (format t " ~a=\"~a\"" (string-downcase (car att)) (cdr att))) ;;5 print attr/value pair | |
| alst) | |
| (princ #\>)) ;;6 closing angle bracket |
This file contains hidden or 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
| for i in range(1, 101): print(i) if i%3 and i%5 else (print(i, "fizz") if i%5 else (print(i, "buzz") if i%3 else print(i, "fizzbuzz"))) |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| #this module is used for treating "Sleipnir2.x" DOM manipulation | |
| from PNR2.vars import * | |
| from PNR2.str import * | |
| from PNR2.treatLocation import * | |
| from datetime import date, datetime, timedelta, time | |
| import re, sys, time | |
| import random, math | |
| import win32com.client, win32ui |
This file contains hidden or 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
| File Edit Options Buffers Tools HTML Help | |
| {% extends "ykmBase.html" %} | |
| {% block cssExtend %} | |
| <link href="{{ STATIC_URL }}css/datepicker.css" rel="stylesheet"> | |
| <style> | |
| body { | |
| padding-top: 40px; | |
| padding-bottom: 40px; | |
| background-color: #f5f5f5; |
This file contains hidden or 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
| // Programming JavaScript | |
| // CH6 - Ojbect | |
| // Property Attribute | |
| // -> writable - specifies whether the value of the property can be set. | |
| // -> enumerable - specifies whether the property name is returned by a for/in loop. | |
| // -> configurable - specifies whether the property can be deleted and whether its attributes can be altered. | |
| // Object Attribute |
This file contains hidden or 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
| //start(T_T) | |
| !function() { | |
| var d3 = {version: "3.4.11"}; | |
| //compat_start----------------------------------------------------------------(T_T) | |
| //Add compatibility shim for setAttribute[NS] in IE9. | |
| //compat.date(T_T) | |
| //Fix for IE9's style.setProperty. | |
| if (!Date.now) Date.now = function () { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| //it's useful creating graph, even curved graph, ex y = a*x^2 | |
| var continuousLine = (function() { | |
| var samples = d3.range(0, 1+1e-6, 2/width);//split [0, 1] to 211 division, fine division makes almost curve line | |
| var discreteLine = d3.svg.line() | |
| .x(function(d, i) { return xS(samples[i]); }) | |
| .y(function(d) { return yS(d); }); | |
| return function(f){ | |
| return discreteLine(samples.map(f));//very short line's sequence makes curve | |
| }; |
NewerOlder