Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Post top tier code

Name: Anonymous 2014-07-22 13:29

Can be yours or not, I just want to see something good.

Name: Anonymous 2014-08-15 17:02

>>78
Why ncurses? Why not just curses?

Name: Anonymous 2014-08-15 17:25

Self-hosting Symta compiler...

use prelude compiler reader macro

GRootFolder = Void
GSrcFolders = Void
GDstFolder = Void
GHeaderTimestamp = Void
GMacros = Void

read_normalized Text =
| Expr = read Text
| case Expr [`|` @As] Expr
X [`|` X]

skip_macros Xs = Xs.skip{X => X.1.is_macro}

// FIXME: do caching
get_lib_exports LibName =
| for Folder GSrcFolders
| LibFile = "[Folder][LibName].s"
| when file_exists LibFile
| Text = load_text LibFile
| Expr = read_normalized Text
| leave: case Expr.last [export @Xs] | skip_macros Xs
Else | Void
| bad "no [LibName].s"

c_runtime_compiler Dst Src =
| RtFolder = "[GRootFolder]runtime"
| unix "gcc -O1 -Wno-return-type -Wno-pointer-sign -I '[RtFolder]' -g -o '[Dst]' '[Src]'"

c_compiler Dst Src =
| RtFolder = "[GRootFolder]runtime"
| unix "gcc -O1 -Wno-return-type -Wno-pointer-sign -I '[RtFolder]' -g -fpic -shared -o '[Dst]' '[Src]'"

file_older Src Dst =
| DstDate = if file_exists Dst then file_time Dst else 0
| Src^file_time << DstDate and GHeaderTimestamp << DstDate

compile_runtime Src Dst =
| when file_older Src Dst: leave Void
| say "compiling runtime..."
| Result = c_runtime_compiler Dst Src
| when Result <> "": bad Result

add_imports Expr Deps =
| unless Deps.size: leave Expr
| [[_fn (map D Deps D.1) Expr]
@(map D Deps [_import [_quote D.0] [_quote D.1]])]

compile_expr Name Dst Expr =
| Uses = [core]
| Expr <= case Expr
[`|` [use @Us] @Xs]
| Uses <= [@Uses @Us]
| [`|` @Xs]
Else | Expr
| Deps = Uses.tail
| for D Deps: unless compile_module D: bad "cant compile [D].s"
| say "compiling [Name]..."
| Imports = (map U Uses: map E U^get_lib_exports: [U E]).join
| Imports = Imports.keep{X => X.1.is_text} // skip macros
| ExprWithDeps = add_imports Expr Imports
| ExpandedExpr = macroexpand ExprWithDeps GMacros
| CFile = "[Dst].c"
| ssa_produce_file CFile ExpandedExpr
| Result = c_compiler Dst CFile
| unless file_exists Dst: bad "[CFile]: [Result]"
| Deps

load_symta_file Filename =
| Text = load_text Filename
| read_normalized Text

compile_module Name =
| for Folder GSrcFolders
| SrcFile = "[Folder][Name].s"
| when file_exists SrcFile
| DstFile = "[GDstFolder][Name]"
| DepFile = "[DstFile].dep"
| when file_exists DepFile
| Deps = DepFile^load_symta_file.1
| CompiledDeps = map D Deps: compile_module D
| when file_older SrcFile DstFile and CompiledDeps.all{X => have X and file_older X DstFile}:
| leave DstFile
| Expr = load_symta_file SrcFile
| Deps = compile_expr Name DstFile Expr
| DepsText = Deps.infix{' '}.unchars
| save_text DepFile DepsText
| leave DstFile
| Void

build BuildFolder =
| let GMacros 'macro'^load_library.keep{X => X.1.is_macro}.as_table
GRootFolder '/Users/nikita/Documents/git/symta/'
GSrcFolders ["[BuildFolder]src/" "[GRootFolder]src/"]
GDstFolder "[BuildFolder]lib/"
GHeaderTimestamp (file_time "[GRootFolder]/runtime/runtime.c")
| RuntimeSrc = "[GRootFolder]/runtime/runtime.c"
| RuntimePath = "[BuildFolder]run"
| compile_runtime RuntimeSrc RuntimePath
| DstFile = compile_module main
| when no DstFile: bad "cant compile main.s"
| unix "[RuntimePath] '[GDstFolder]'"

export build

// /Users/nikita/Documents/git/symta/build/test/src/main.s
use build

// compile self second time
build "/Users/nikita/Documents/git/symta/build/test2/"

Name: od says 2014-08-15 18:36

not that any of you fucking nigger deserve it:

(
s.waitForBoot{

// stack of detuned sins
SynthDef(\bd, {
arg out = 0, amp= 1, pan = 0, attack = 0, rel= 0.1,
freq = 160, click = 0, depth = 3, detune = 10;
var env, layers, sig;

env = EnvGen.ar(Env.perc(0, rel, amp, -10), doneAction:2);

layers = [];
depth.do {|i|
layers = layers ++ SinOsc.ar(i * detune + freq, click, env);
};

Out.ar(out, Pan2.ar(Mix(layers), 0));
}).add;

// 3 detuned swooping sins
SynthDef(\bd2, {|amp= 1, rel= 0.1, freq = 160, click = 0|
var e= EnvGen.ar(Env.perc(0, rel, amp, -10), doneAction:2);
var layers = [
SinOsc.ar(Line.kr(freq - 10 * 2, freq - 10, rel), click, e*0.4),
SinOsc.ar(Line.kr(freq * 2, freq, rel), click, e*0.4),
SinOsc.ar(Line.kr(freq + 10 * 2, freq + 10, rel), click, e*0.4),
];
var z= Mix(layers);
Out.ar(0, Pan2.ar(z, 0));
}).add;

SynthDef(\bz, {|amp= 1, rel= 0.25, freq= 400|
var e= EnvGen.ar(Env.perc(0.01, rel, amp), doneAction:2);
var z= BPF.ar(Blip.ar(e+1*(freq*0.1), 3), freq*2, 0.1, amp*10*e);
Out.ar(0, Pan2.ar(z, 0));
}).add;

// 5k bpf whitenoise
SynthDef(\hh, {|amp= 1, rel= 0.05|
var e= EnvGen.ar(Env.perc(0, rel, amp, -10), doneAction:2);
var z= WhiteNoise.ar(e);
z= BPF.ar(z, 5000, 0.4);
Out.ar(0, Pan2.ar(z, 0, 1.5));
}).add;

SynthDef(\clap, {|out=0, amp=1, rel=0.2|
var e= EnvGen.ar(Env.perc(0.01, rel, amp), doneAction:2);
var sig=BPF.ar(PinkNoise.ar(e), Line.kr(300, 30, rel), 4);
Out.ar(out, Pan2.ar(sig, 0));
}).add;
};
)

(
t = TempoClock.default;
t.tempo = 135 / 60;
)

(
~bd.stop;
~bd = Pbind(
\instrument, \bd,
// \dur, Pseq(#[1, 1, 1, 1], inf),

// \dur, Pseq(#[1, 1, 1, 0.75, 0.25], inf),
// \click, Pseq(#[0, 0, 0.1, 0.1, 0.2], inf),

\dur, Pseq(#[1, 1, 0.75, 0.25, 0.5, 0.5], inf),
\amp, 0.6,
// \dur, Pseq(#[1, 1, 1, 0.5, 0.5], inf),
// \dur, Pseq(#[1, 1, 0.5, 0.5, 0.5, 0.5], inf),
).play(t, quant: 4);
)

(
~hh.stop;
~hh = Pbind(
\instrument, \hh,
\amp, Pseq(0.15 * [0, 1], inf).value,
\dur, 0.5,
).play(t, quant: 4);
)

(
~clap.stop;
~clap = Pbind(
\instrument, \clap,
\dur, 2,
\amp, 1,
\rel, Pseq([0.1, 0.1, 0.07, 0.15], inf),
).play(t, quant: [4, 1]);
)

(
~bd2.stop;
~bd2 = Pbind(
\instrument, \bd2,
\amp, 0.6,
).play(t, quant: [4, 0.48]);
)

(
~bz.stop;
~bz = Pbind(
\instrument, \bz,
\amp, Pseq([0, 0, 1, 0, 1], inf),
\dur, 0.5,
).play(t, quant: 4);
)

Name: od says 2014-08-15 18:37

(and that's SuperCollider if you had to ask)

ADMIN WHERE IS THE POSTFRES

Name: Anonymous 2014-08-15 23:26

>>83,84
Where's your meds?

Name: Anonymous 2014-08-16 0:56

>>81
What's wrong with ncurses?

Name: Anonymous 2014-08-16 1:06

>>84
that looks pretty interesting, thanks kat =)

Name: Anonymous 2014-08-16 7:13

>>84
Why the hell do you want a postgres server?

Name: Anonymous 2014-08-16 9:33

>>84

Lisp Music >>> SuperCollider >>>>>>>>>>> PoopyLoops

Name: Anonymous 2014-08-16 11:51

>>85
I'm not on any medication thank you very much. I'm what you could call "a functional lunatic". Sometimes yeah, I guess idgaf. I do though. I mean can you believe that this is what I do for fun?

>>88
I don't know why, I just know that we need a Postgres server. I don't deal in rationalisations.

A preliminary schema has been put on the SVN. It is not in a working condition right now (IIRC). Already though, I am unsatisfied with it.

We cannot impose "accounts" on people who want to use the system. The most we can really allow for is the notion of "sessions", which can be started anonymously. After a session has been established, additional capabilities can be loaded into it (or dropped) by proving that you posses a certain secret.

Therefor, the public interface of the schema needs to change. I guess it'll take a few iterations. If you want GOD tier code keep an eye on that or better yet help out. I feel like once we get the model down, we can start thinking about P2P distribution and world domination. Probably not on a postgres level though, we'll need to write something on top first so the masses can enjoy it.

Name: Anonymous 2014-08-16 12:33

Prominent organizations and products that use PostgreSQL as the primary database include:
International Space Station

=)

Name: Anonymous 2014-08-16 17:55

>>90
I'm not on any medication
Just whom are you kidding, American? You all are constantly on medication because the pharmaceutical industry controls your mind and turns you into pill-gulping drug addicts for life.

Name: Anonymous 2014-08-17 10:18

entry-level restricted boltzmann machine (missing the energy function)

%%data = [1,0,0,1; 1,0,1,0]

%%data = rand(8,4)

n = size(data, 1);

m = size(data, 2);

neurons = 50;

decay = 0.95;

lr = 0.2;

weights = [];

weights(1:m, 1:neurons) = 0;

weights = randn(size(weights)) ./ 100.0;

delta = zeros(size(weights));

pdata = [];

batchsize = 2000;

blocki = [1:batchsize];

for(iter=1:2000)

blocki = mod(blocki .+ batchsize, n) .+ 1;

shortdata = data(blocki, :);

insig1b = shortdata * weights;

sig1b = sigmoid(insig1b);

pos = shortdata' * sig1b;

insig2a = sig1b * weights';

sig2a = sigmoid(insig2a);

insig2b = sig2a * weights;

sig2b = sigmoid(insig2b);

%% neg = data' * sig2b; %%??

neg = sig2a' * sig2b;

delta = delta .* decay .+ ((pos .- neg) ./ n) .* lr;

weights = weights .+ delta;

pdata(iter) = sum(abs(shortdata(:) .- sig2a(:)) ./ (batchsize * m));

fprintf("%citer %i, err %i / 100 ", 13, iter, pdata(iter) * 100);

endfor;

hold on;

plot(pdata, '-b')

Name: Anonymous 2014-08-17 10:40

>>89
I love LISP, especially Kana. Too bad they only did one album.

Name: Anonymous 2014-08-17 10:52

>>93
oh and sampling too..

sig = @(z) 1.0 ./ (1.0 .+ e .^ -z);

Name: Anonymous 2014-08-18 13:35

I did this program that counts from 1 to 10

#include <stdio.h>

int main(void)
{
int i = 0;
do if(++i-2>2<<2) break;
while (printf("%d\n",i));
}

Name: Anonymous 2014-08-18 20:20

>>96
it looks like perl

Name: Anonymous 2014-08-21 16:02

>>96

2>2<<2
This looks like some kind of smilie >>2<<

Name: Anonymous 2014-08-21 17:05

>>97

likely some mathlab rip off

Name: Anonymous 2014-08-21 23:54

>>97
>>99
fuk u
that's some rock-solid straight C! Right there!

>>98
Thanks

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List