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
<ul> | |
<li class="item1">Text 1</li> | |
<li class="item2">Some text 2</li> | |
<li class="item3">Dota 2</li> | |
<li class="item4">Moon</li> | |
</ul> |
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
var code1 = "0010110111011111001001000010110011011100111001101" | |
var code2 = "1102201100200102001002011102220011020111000220110" | |
function decodeMessage(message) { | |
if (message.length != 49){ | |
throw new Error("Bad length"); | |
} | |
var ans = []; | |
for (var i = 1; i < message.length; ++i) { | |
ans[ans.length] = (message[i] != message[i-1] ? 1 : 0); |
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
;(defmacro while (conditions &body body) | |
; '(loop while , condition | |
;) | |
(defun vector-product(x y) | |
(reduce '+ 0 (map 'list #'* x y))) | |
(setq a (list (list 1 2) (list 3 4))) | |
(setq b (make-array '(2 2) :initial-element 2)) | |
; 2 2 |
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
(defclass tagged () ((tag :reader get-tag :writer set-tag :initform "Empty tag" :initarg :tag))) | |
(defclass 3d-point (tagged) | |
( | |
(x :reader get-x :writer set-x :initarg :x) | |
(y :reader get-y :writer set-y :initarg :y) | |
(z :reader get-z :writer set-z :initarg :z) | |
) | |
) |
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
function SpaceShip(pilot, maxSpeed) { | |
this.pilot = pilot; | |
this.maxSpeed = maxSpeed; | |
} | |
SpaceShip.UPDATE_PILOT = "updatePilot"; | |
SpaceShip.prototype.updatePilot = function (newAge, newSkill) { | |
var notifier = Object.getNotifier(this); | |
var self = this; |
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
function Schedule (pretend, real) { | |
this.morning = pretend["morning"]; | |
this.evening = pretend["evening"] | |
var morning = Symbol("morning") | |
var evening = Symbol("evening") | |
this[morning] = real["morning"]; | |
this[evening] = real["evening"]; |
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
;(load "1.lsp") | |
(setq tree '(1 (2 5) 6 (10 (14 (25 27) 40)))) | |
(print tree) | |
(defun traverse-tree(tree depth) | |
(if (atom tree) | |
(progn (funcall func tree) (return-from traverse-tree)) | |
) | |
(let ((list-len (length tree))) |
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
;Macro study | |
(defun range-helper(x) | |
(if (= x 0) | |
(list x) | |
(cons x (range-helper (- x 1))) | |
) | |
) | |
(defun range (x) | |
(reverse (range-helper (- x 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
<html> | |
<head> | |
<title>English learner</title> | |
<link rel="stylesheet" type="text/css" href="bower_components/bootstrap/dist/css/bootstrap.css"> | |
<link rel="stylesheet" type="text/css" href="1.css"> | |
</head> | |
<body ng-app="LearnerApp" ng-controller="WordCtr"> | |
<div class="navbar navbar-static"> | |
<div class="container"> | |
<div class="navbar-header"> |
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
#from os import urandom | |
from random import randint | |
from time import * | |
__author__ = 'mlavrynenko' | |
smal_rsa_primes = [ | |
2 , 3 , 5 , 7 , 11 , 13 , 17 , 19, | |
23 , 29 , 31 , 37 , 41 , 43 , 47 , 53, | |
59 , 61 , 67 , 71 , 73 , 79 , 83 , 89, | |
] |
OlderNewer