Skip to content

Instantly share code, notes, and snippets.

View SQReder's full-sized avatar
💭
... nihil supernum

Nubami SQReder SQReder

💭
... nihil supernum
  • Rocket Cats
  • Saint Petersburg
View GitHub Profile
@SQReder
SQReder / countdown3.lua
Created November 15, 2012 23:53
Script: countdown3.lua:21: attempt to perform arithmetic on a nil value
PROPERTIES = {year=0, month=0, day=0, hour=0, min=0, sec=0, fintext=""}
function Initialize()
RELEASEDATE = {}
setmetatable(RELEASEDATE, getmetatable(PROPERTIES))
for k,v in pairs(PROPERTIES) do
if k ~= fintext then
RELEASEDATE[k] = v
@SQReder
SQReder / main.clj
Created January 6, 2013 04:01
плющило ночью
(ns your-application
(:use clojure.math.numeric-tower))
;
(defn rndgen_recur [l c n]
(if (= c n)
l
(recur (conj l (rand 10)) (inc c) n)))
(defn rndgen [n]
(rndgen_recur () 0 n))
@SQReder
SQReder / main.clj
Created January 6, 2013 04:01
thtrt
(ns your-application
(:use clojure.math.numeric-tower))
;
(defn rndgen_recur [l c n]
(if (= c n)
l
(recur (conj l (rand 10)) (inc c) n)))
(defn rndgen [n]
(rndgen_recur () 0 n))
@SQReder
SQReder / main.clj
Created January 6, 2013 04:02
Плющило ночью
(ns your-application
(:use clojure.math.numeric-tower))
;
(defn rndgen_recur [l c n]
(if (= c n)
l
(recur (conj l (rand 10)) (inc c) n)))
(defn rndgen [n]
(rndgen_recur () 0 n))
@SQReder
SQReder / main.clj
Last active December 10, 2015 17:08
Попробовал решить еще двумя способами. Кажется, нашел неплохое решение. Хотя и не удовлетворен. Сжирает добрых 400 метров оперативы. Хрень какая-то. Нахрен такие апетиты!
(ns your-application
(:use clojure.math.numeric-tower))
(import java.util.Vector)
;region генератор списка случайных чисел с хвостовой рекурсией
(defn rndgen_recur [l c n]
(if (= c n)
l
(recur (conj l (rand 10)) (inc c) n)))
#include <QTextStream>
#include <QDateTime>
QTextStream cout(stdout);
class TimeSpan {
qint64 _msecs;
static const qint64 c_second = 1000;
static const qint64 c_minute = 60;
@SQReder
SQReder / chase.clj
Last active December 17, 2015 00:10
(dialog chase_main "The chase" -1 -1 600 400
(pushButton pbStartGame "Start game" 0 0 450 20)
(pushButton pbIntro "Intro" 0 20 450 20)
(tabs 0 50 450 330
(tab tabPlayers "Players"
(gridLayout
(1 1 (lineEdit leP1 "Pl1"))
(1 2 (lineEdit leP2 "Pl2"))
(1 3 (lineEdit leP1 "Pl3"))
(1 4 (lineEdit leP2 "Pl4"))
@SQReder
SQReder / fibo.clj
Last active December 17, 2015 03:48
lol
(fibo 10)
10
(if (< N 2) 1 (+ (fibo (- N 1)) (fibo (- N 2))))
(< N 2)
N
2
QVariant(QVariantList, (QVariant(int, 10) , QVariant(int, 2) ) )
(+ (fibo (- N 1)) (fibo (- N 2)))
(fibo (- N 1))
(- N 1)
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" href="#{ __ ССЫЛКО НА ИД СОДЕРЖИМОГО __ }">
{ __ МЕСТО ДЛЯ ЗАГОЛОВКА __ }
</a>
</div>
<div id="{ __ ИД СОДЕРЖИМОГО __ }" class="accordion-body collapse in">
<div class="accordion-inner">
{ __ МЕСТО ДЛЯ СОДЕРЖИМОГО__ }
</div>
(function() {
var jq;
if (!window.jQuery) {
jq = document.createElement('script');
jq.type = 'text/javascript';
jq.src = '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js';
return document.getElementsByTagName('head')[0].appendChild(jq);
}
})()
setTimeout(function() {