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
; Given a string of comma separated integers, write a function which | |
; returns a new comma separated string that only contains the numbers | |
; which are perfect squares. | |
(fn [s] | |
(apply str | |
(interpose \, | |
(filter #(= (Math/sqrt %) | |
(Math/floor (Math/sqrt %))) | |
(map #(Integer/parseInt %) |
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
(defn fib[x] | |
(loop [n 0 r ()] | |
(println n, r) | |
(cond (= x n) r | |
(or (= n 0) (= n 1)) (recur (inc n) (conj 1 r)) | |
:else (recur (inc n) (conj (+ (last r) (butlast r)) r))))) |
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
class ChannelStaticMeta(models.Model): | |
cstmid = models.AutoField(primary_key=True) | |
channels_cid = models.ForeignKey(Channel, db_column="cid", unique=True) | |
regex = models.CharField(max_length=255, null=False, blank=True) | |
class Meta: | |
db_table = u"channels_static_meta" | |
verbose_name = "Channel Static Meta" | |
verbose_name_plural = "Channel Static Metas" |
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
notes = 'Recreate the problem: %(What do we need to do to recreate the problem? )s \n \n \ | |
Expected behavior: %(What behaviour were you expecting (vs what is actually happening)?)s \n \n \ | |
Priority: %(Priority)s \n \n \ | |
Browswer: %(What browser were you using?)s \n \n \ | |
Other information: %(Is there any other information that would help us troubleshoot this?)s' \ | |
% bug_details |
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
[Pp][Rr][Oo][Gg][Rr][Aa][Mm] fprintf(yyout,"%s 7 ",yytext); | |
([\"][^\"]*[\"])|([\'][^\']*[\']) fprintf(yyout,"%s 15 ",yytext); | |
("\(\*"[^\)\*]*"\)\*")|"(*)" (for whitespace) | |
replace the top two lines with their corresponding fprintf's in the lexfile provided. |
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
int whichSet = -1; | |
int wordBase = word; | |
int i; | |
int hit = 0; | |
while(1) { | |
if (wordBase % cache->blockSizeInWords == 0) | |
break; | |
wordBase--; | |
} |
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
function ParzenBiVarUp() | |
h = .5; | |
d = 2; | |
load Hw3data2c.txt | |
[n colSize] = size(Hw3data2c); | |
input = Hw3data2c; | |
minD_x = min(Hw3data2c(:,1)); |
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
function Gaussian() | |
h = .5; | |
d = 1; | |
hold on | |
load Hw3data2a.txt; | |
[n colSize] = size(Hw3data2a); | |
x = sort(Hw3data2a); |
NewerOlder