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
""" | |
Toy demonstration of chain-of-thought and consensus prompting using OpenAI API. | |
© Riley Goodside 2022 | |
""" | |
import os | |
import re | |
from statistics import mode |
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
$ curl -v "http://a.jumptap.com/a/ads?l=en&pub=INVALID&site=pa_okcupid2_okcupid_mob_web&spot=pa_okcupid2_okcupid_mob_web_adspot&v=v30" | |
* About to connect() to a.jumptap.com port 80 (#0) | |
* Trying 209.94.144.164... connected | |
* Connected to a.jumptap.com (209.94.144.164) port 80 (#0) | |
> GET /a/ads?l=en&pub=INVALID&site=pa_okcupid2_okcupid_mob_web&spot=pa_okcupid2_okcupid_mob_web_adspot&v=v30 HTTP/1.1 | |
> User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.15 libssh2/1.2.6 | |
> Host: a.jumptap.com | |
> Accept: */* | |
> |
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
sudo aptitude install python-pip | |
sudo pip install virtualenv | |
sudo pip install virtualenvwrapper |
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
$re = qr/ | |
. # single letter is a palindrome | |
| | |
(.) # first letter | |
(??{ $re })?? # apply recursivly (not interpolated yet) | |
\1 # last letter | |
/x; |
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
/* | |
ORIGINAL SOURCE: | |
I yelled out, "Hello!" | |
But was it too late? | |
There was not a word in reply -- none | |
I will say nothing if you call back, you know | |
How could I? Did I never truly love you? | |
Perhaps tomorrow we will know why |
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
i64478@SysEngineering1:~$ perl <<PERL | |
> # Note that there is no need for a -e flag. | |
> print "Helo, world!\n"; | |
> PERL | |
Helo, world! | |
i64478@SysEngineering1:~$ perl -e 'print "Hello, world!\n";' | |
Hello, world! | |
i64478@SysEngineering1:~$ perl 'print "Hello, world!\n";' | |
Can't open perl script "print "Hello, world!\n";": No such file or directory | |
i64478@SysEngineering1:~$ |
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
1 #! /usr/bin/env ruby | |
2 | |
3 $:.unshift(File.dirname(__FILE__) + '/../lib') unless | |
4 $:.include?(File.dirname(__FILE__) + '/../lib') | |
5 | |
6 require 'parser' | |
7 require 'test/unit' | |
8 | |
9 | |
10 class ParserTest < Test::Unit::TestCase |
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
CC=gcc | |
CFLAGS=-Wall -g SND_FILE=.SUFFIX= | |
.SUFFIX=.c.o | |
all : rra2wav wav2rra rraamplitude rraspeed audiocc rravocoder rrahartley rralog_compress rraecho rrawave_gen rrasquare_gen rratriangle_gen rracrush rracat | |
rra2wav : rra.o rra2wav.o | |
$(CC) $(CFLAGS) $(SND_FILE) -o rra2wav rra2wav.o rra.o | |
wav2rra : rra.o wav2rra.o | |
$(CC) $(CFLAGS) $(SND_FILE) -o wav2rra wav2rra.o rra.o |
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
traditional <- data.frame( | |
a = 4, | |
b = list('caterpillars', 'porcupines', 'elephants', | |
'electric eels that approach silently', | |
paste(something()) | |
) | |
) | |
lispy <- | |
data.frame(a = 4, |
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
>> if (foo || true) then 'Hi' else 'Bye' end | |
NameError: undefined local variable or method `foo' for main:Object | |
from (irb):1 | |
>> foo = nil | |
=> nil | |
>> if (foo || true) then 'Hi' else 'Bye' end | |
=> "Hi" | |
>> foo = false | |
=> false | |
>> if (foo || true) then 'Hi' else 'Bye' end |
NewerOlder