[ home ] [ int ] [ biz / edi ] [ vir / cuck ] [ mod ] [ meta / test / arch ] [ wiki / map ] [ register / login / my threads / replied threads / followed threads ]

/int/ - International (30 readers)

>he doesn't know what "Bronnen" means.
Name
Email
Subject
Comment
File
Embed

File: 1538690889535.png (15.71 KB, 581x457, nec.png) ImgOps Google

Porkistan ANUSOID Newark, Ostrobothnia  No.2555427 +17 [Last 50 Posts]

israel mod

you were right: Golang is such a pilled language

Porkistan ANUSOID Newark, Ostrobothnia  No.2556388 +7 

>>2555430
You?

United Kingdom 𝔤𝔦𝔫𝔤𝔢𝔯 London, England  No.2556389 +4 

>>2556388
Furious

Palestine, State of the palestinian orbimod Khan Yunis, Gaza  No.2556405 +2 

australian colon troubles pilled me on it so kudos to him,,,

Palestine, State of the palestinian moronic twat Khan Yunis, Gaza  No.2556406 +2 

>>2555430
edgemaster

why hate golang

United States Unskilled Laborer New York City, New York  No.2556413 +4 

>>2556405
>australian colon troubles
Anusoid in a few months

United States Unskilled Laborer New York City, New York  No.2556414 +7 

You'll always be American to me :)

Sweden Proxy the swedish reddit suede  No.2556417 +1 

I only know Python and that too somewhat in between beginner and intermediate and I'm soon going to do tons of projects.

Palestine, State of the palestinian sonichu Khan Yunis, Gaza  No.2556419 +1 

>>2556414
Correct.

Palestine, State of the palestinian amber Khan Yunis, Gaza  No.2556420 +2 

>>2556417
bro

turn soon into right now

Porkistan ANUSOID Newark, Ostrobothnia  No.2556424 +1 

>>2556417
Go is like C with more good parts and Python with less bad parts

Porkistan ANUSOID Newark, Ostrobothnia  No.2556432 +2 

>>2556414
I have never been an ameri
I have never been an ameri

United Kingdom bateman Carluke, Scotland  No.2556462 +3 

>>2556417
python is lodsofemone mode these days if you actually learn the standard library in its full depth and learn Django + numpy/scikit
as in graduates getting 6 figures after 3 years
but you have to know what youre doing in those jobs

Palestine, State of the palestinian vagiworshipper Khan Yunis, Gaza  No.2557500 +1 

File: 1538787341594.png (137.32 KB, 943x1032, ClipboardImage.png) ImgOps Google

>>2556424
error handling can get a bit too verbose sometimes :S

they're drafting error handling improvements for Go 2 right now

Porkistan ANUSOID Newark, Ostrobothnia  No.2557504 +2 

>>2557500
Verbose is okay
properly checked C code looks like that too

Palestine, State of the palestinian beancuck Khan Yunis, Gaza  No.2557510 +1 

>>2557504
good morning anusoid

how are the melbourne beaches today?

Finland the finnish rick Oulu, Pohjois-Pohjanmaa  No.2557511 +6 

Based gaza finn

Sweden vastra Karlskoga, Orebro lan  No.2557516 +1 

>>2557511
oulu opfer

United States Football 'eritage Trenton, New Jersey  No.2557530 +1 

>>2555427
good pic

Porkistan ANUSOID Newark, Ostrobothnia  No.2557531 +1 

>>2557510
It will be summer soon
Imagine leaving afri for more afri

Palestine, State of the palestinian futanari Khan Yunis, Gaza  No.2557532 +1 

>>2557504
say you have a byte (number from 0 to 255, uniform distribution) and you want to compute its discrete log2

assuming there are parts of code that are much slower to compute so picking a method has no real impact on performance

from most performant to least performant

size 256 lookup table O(1)

series of switch - case or if statements that implement binary search via bit masks (or greater/lesser statements) O(log(n))

for loop that implement binary search

for loop that checks every bit individually O(n)

casting to a float and then extracting the exponent O(1) (but really slow compared to the others when dealing with only 8 bits)

or something else

Porkistan ANUSOID Newark, Ostrobothnia  No.2557570 +1 

>>2557532
>assuming there are parts of code that are much slower to compute so picking a method has no real impact on performance
Answered your own question shizo?
Since the lookup table is so minuscule I'd probably go with that. Why not.

Australia the australian lumpenprole Sydney, New South Wales  No.2557573 +1 

it was me not bydlocoder who spoke volumes of go

Porkistan ANUSOID Newark, Ostrobothnia  No.2557576 +1 

>>2557573
help me get a job in aus

Australia the australian drumpf Sydney, New South Wales  No.2557578 +1 

>>2556424
this is such an incredibly unpilled view

go is C-like syntax but fundamentally its a completely different paradigm and is strongly typed

C is as far away from go as it is from java

Australia the australian aids boy Sydney, New South Wales  No.2557580 +1 

>>2557576
i could get you a job in education in Sydney but you dont have any experience for a coding job right?

Palestine, State of the palestinian rick Khan Yunis, Gaza  No.2557586 +1 

>>2557573
>bydlocoder
yoy?


>>2557570
ye i chose that

but i also implemented everything and ran benchmarks just for fun because she loves to code :)

Porkistan ANUSOID Newark, Ostrobothnia  No.2557588 +1 

>>2557578
Of course it's going to fix C's (many) mistakes like weak typing, but it has clear unix/bell labs heritage in its design. It's not out of line to compare it to C just because it's garbage collected and strongly typed

>>2557580
No work experience, but I have a project portfolio

Porkistan ANUSOID Newark, Ostrobothnia  No.2557590 +1 


Palestine, State of the palestinian house burner Khan Yunis, Gaza  No.2557593 +1 

>>2557588
mom: get a job already deadbeat

me: i'm working on my project portfolio schizo so stfu

>>2557590
yea i visit that page a lot and i've obviously took that part as an inspiration for my question

Porkistan ANUSOID Newark, Ostrobothnia  No.2557594 +2 

>>2557593
>mom: get a job already deadbeat
>me: i'm working on my project portfolio schizo so stfu
unironi what I'm doing right now

Palestine, State of the palestinian adnan Khan Yunis, Gaza  No.2557605 +1 

https://matroska.org/technical/specs/index.html#EBML_ex

to find the size of the variable integer you need to effectively compute 8-log2n of the first digit

the official implementation did it by casting a byte into an int8 and multiplying it by 2 (n += n) until it becomes negative (or over 127)

the number of times it was multiplied would correspond to 7-log2n of the number

but a lookup table is a much better solution (if you have ~256 bytes of memory to spare)

>>2557594
whatcha working on right now

Brazil admin Sao Paulo, Sao Paulo  No.2557610 +1 

>>2556462
i dont know what im doing in my life

Australia the australian whiny emo faggot Sydney, New South Wales  No.2557611 +1 

>>2557532
float casting is computing the logarithm the long way…

Porkistan ANUSOID Newark, Ostrobothnia  No.2557612 +1 

>>2557605
A "chatroom" where users can play digital instruments with one another. All audio is rendered server side rather than having a pure javascript peer to peer connection using webRTC + webaudio or whatever. Using the latter method, people can connect through the client of their choice and the provider has more options with the audio stream (save sessions, etc)

I don't plan on it becoming anything serious but I hope it demonstrates understanding of networking, signal processing, parallelism, optimal memory management for realtime audio, etc that some1 will like it and hire me

Porkistan ANUSOID Newark, Ostrobothnia  No.2557614 +1 

>>2557612
Former method*

Australia the australian einor hugji Sydney, New South Wales  No.2557628 +1 

>>2557612
you could apply for startups but it would be a gamble in terms of stable income

if you wanted a job at a big company you'd need to know someone or have/be doing a degree

Palestine, State of the palestinian zinger Khan Yunis, Gaza  No.2557633 +1 

>>2557611
it's utilising completely different process instructions

it's only 3 times longer than a binary search of an 8-bit integer (masks 0xF0, 0xC, 0x2) (when you cast uint8 to float64 and then Frexp())

it would have the same performance when dealing with a uint64

while a 64 bit binary search would use 0xFFFFFFFF00000000, 0xFFFF0000, 0xFF00, 0xF0, 0xC and 0x2

i'm curious so i'll benchmark it now brb

>>2557612
what protocols are you implementing

what language are you writing it in

Porkistan ANUSOID Newark, Ostrobothnia  No.2557634 +1 

>>2557628
*sighs*
Time to start working on my soy face……


I don't have to be writing code though. I'm trying to because I think I'm okay at it, but puppy just wants any job that doesn't suck

Palestine, State of the palestinian modi chaiwala Khan Yunis, Gaza  No.2557635 +1 

>>2557628
well he knows you…

Porkistan ANUSOID Newark, Ostrobothnia  No.2557640 +1 

>>2557633
Server would be Go
Web frontend in js
And maybe a desktop client in C

Thinking either websockets or maybe just simple GET/POST requests.

Australia the australian funny cat Sydney, New South Wales  No.2557642 +1 

>>2557633
what language are you testing this in?
id suspect you'd get totally different results between low and high level languages

>>2557634
what's your prior work experience (broadly)

Australia the australian house burner Sydney, New South Wales  No.2557644 +1 

>>2557640
>separate client
nigga didn't get the webapp memo

Porkistan ANUSOID Newark, Ostrobothnia  No.2557646 +1 

>>2557642
My prior work experience is teaching English in Japan

lol

Piteå's cranium Proxy Piteå's cranium  No.2557647 +1 

>>2557610
Don't worry, I didn't what I was doing for the last 2 years after dropping out. It's not so difficult, but you need to believe in the process even if it is messy.

Piteå's cranium Proxy Piteå's cranium  No.2557649 +3 

>>2557646
>My prior work experience is teaching English in Japan
Ahhh

Sex tourist

Porkistan ANUSOID Newark, Ostrobothnia  No.2557652 +1 

>>2557644
If I'm supposed to serve desktop and browser users simultaneously I don't see how there can't be separate clients.

Palestine, State of the palestinian pederast Khan Yunis, Gaza  No.2557656 +1 

>>2557640
everyone is on the webassembly webapp with a react ui with typescript meme now

btw go has experimental webassembly support but wasm is pretty gay with garbage collected languages because you need to compile the GC and embed it into the wasm file atm

go with websockets imhotep

also don't use buffers, use pipes whenever you can (make sure to disable POST buffering, when you set up the server, if you use nginx as reverse proxy)

>>2557642
go ofc

this IS a go thread

Palestine, State of the palestinian stem masterrace Khan Yunis, Gaza  No.2557767 +2 

>>2557642
func binSearch8(n uint8) (i int) {
if n&0xF0 != 0 {
n >>= 4
i |= 4
}
if n&0xC != 0 {
n >>= 2
i |= 2
}
if n&0x2 != 0 {
i |= 1
}
return
}

func floatCasting8(n uint8) int {
_, num := math.Frexp(float64(n))
return num - 1
}

func binSearch64(n uint64) (i int) {
if n&0xFFFFFFFF00000000 != 0 {
n >>= 32
i |= 32
}
if n&0xFFFF0000 != 0 {
n >>= 16
i |= 16
}
if n&0xFF00 != 0 {
n >>= 8
i |= 8
}
if n&0xF0 != 0 {
n >>= 4
i |= 4
}
if n&0xC != 0 {
n >>= 2
i |= 2
}
if n&0x2 != 0 {
i |= 1
}
return
}

func floatCasting64(n uint64) int {
_, num := math.Frexp(float64(n))
return num - 1
}

goos: linux
goarch: amd64
Benchmark_binSearch8-8 1000000000 2.29 ns/op
Benchmark_floatCasting8-8 200000000 7.40 ns/op
Benchmark_binSearch64-8 2000000000 0.44 ns/op
Benchmark_floatCasting64-8 100000000 11.3 ns/op
PASS
ok


it ended up being processor optimized for uint64 lol

United States orion Portland, Oregon  No.2557790 +1 

>>2557767
when did you start into programming languages

United States the american drumpf Minneapolis, Minnesota  No.2557810 +1 

>>2557790
when DId you StArt into programming languages

Australia the australian claire Sydney, New South Wales  No.2557813 +1 

>>2557767
the main thing to learn from this is to use a math library log(2,n) that will be implemented low level in another language because Go is high level and won't compile anything like you'd expect it to

Piteå's cranium Proxy (muokattu) Piteå's cranium  No.2557816 +1 

>>2557790
While interning at MOSSAD

Australia the australian leafcuck Sydney, New South Wales  No.2557817 +1 

>>2557767
the fact that go has uintN types is to make C programmers feel more at home

Palestine, State of the palestinian speedrunner Khan Yunis, Gaza  No.2557827 +1 

>>2557813
Frexp() is implemented low level and is 4 times faster than Log2() because it requires only one int<->float conversion

Palestine, State of the palestinian avian Khan Yunis, Gaza  No.2557832 +1 

// Log2 returns the binary logarithm of x.
// The special cases are the same as for Log.
func Log2(x float64) float64

// Frexp breaks f into a normalized fraction
// and an integral power of two.
// It returns frac and exp satisfying f == frac × 2**exp,
// with the absolute value of frac in the interval [½, 1).
//
// Special cases are:
// Frexp(±0) = ±0, 0
// Frexp(±Inf) = ±Inf, 0
// Frexp(NaN) = NaN, 0
func Frexp(f float64) (frac float64, exp int)

Palestine, State of the palestinian scaly Khan Yunis, Gaza  No.2557840 +1 

>>2557817
btw have you heard of the epic iris(https://github.com/kataras/iris) debacle/drama ?_?

Australia the australian kirinorway Sydney, New South Wales  No.2557842 +1 

>>2557827
abstractly, you're efficiency gain there is due to the approximation, right ?

>>2557840
nope whut

Australia the australian mongol Sydney, New South Wales  No.2557846 +1 

>>2557840
i used gin for backend

Palestine, State of the palestinian gamer Khan Yunis, Gaza  No.2557854 +1 

>>2557842
>abstractly, you're efficiency gain there is due to the approximation, right ?
the efficiency gain is because Frexp decomposes a float to its mantissa and exponent which is how a float number is stored

when you run a log2, you not just extract the exponent (which is an integer), you also have to calculate a log of the mantissa ([1/2,1)->[-1,0)) and add it to the exponent

and the type conversions back and forth

>nope whut

http://www.florinpatan.ro/2016/10/why-you-should-not-use-iris-for-your-go.html
the dev is staffas and if you just bing/duckduckgo iris you'll see a lot of epic shit

xe even implemented benchmark specific request caching to cheat and gain the highest scores

but the biggest part is stealing others' code and other epic fuckery,,, it's all in that blog post

>>2557846
i know

i've tried gin

i prefer echo

not that it really matters

United States the american beanchad Minneapolis, Minnesota  No.2557855 +5 

File: 1538799560291.jpg (20.42 KB, 258x395, 1011062_436867599750111_13….jpg) ImgOps Exif Google

>>2557854
flouride stare ayyyyyyyeuuu

Palestine, State of the palestinian funny cat Khan Yunis, Gaza  No.2557856 +1 

>>2557855
everything ok hon?

United States the american futanari Minneapolis, Minnesota  No.2557859 +5 

File: 1538799793055.jpg (90.3 KB, 612x612, 11205943_561383894001492_5….jpg) ImgOps Exif Google


Australia the australian 4channer Sydney, New South Wales  No.2557860 +1 

>>2557854
i love the benchmark faking

Brazil admin Sao Paulo, Sao Paulo  No.2559189 +1 


Palestine, State of the palestinian morty Khan Yunis, Gaza  No.2559316 +1 

>>2557504
what about monads

Porkistan ANUSOID Newark, Ostrobothnia  No.2559373 +1 

File: 1538866642864.mp3 (86.46 KB, 255x255, ass.mp3) ImgOps Google

synthesis: ok
polyphony: ok

Porkistan ANUSOID Newark, Ostrobothnia  No.2559376 +1 

>>2559373
(It's 4 different "users" playing different sines at once, rather than a single instrument)

United States Unskilled Laborer New York City, New York  No.2560299 +6 

>>2559373
Vastra simulator

Palestine, State of the palestinian beefer Khan Yunis, Gaza  No.2562449 +1 

File: 1539007222410.png (116.04 KB, 508x767, ClipboardImage.png) ImgOps Google


Australia the australian milcel Sydney, New South Wales  No.2562461 +1 

>>2562449
this is a great meme

goddam

Porkistan ANUSOID Newark, Ostrobothnia  No.2562585 +1 

File: 1539015135237.jpg (411.79 KB, 1124x900, retard.jpg) ImgOps Exif Google

Macabre how quickly and well everything is working

I wrote a similar program (with much more complex synthesis) in C last year and I spent so much time trying to reproduce deadlocks, chasing segfaults, making all kinds of weird unions with function pointers to simulate primitive OOP, etc and it still ran like crap

I think types with methods is all the good things about OOP without the bullshit. It's such a clean ballsack feeling

Palestine, State of the palestinian joonas Khan Yunis, Gaza  No.2562596 +1 

>>2562585
interfaces are very good as well

Palestine, State of the palestinian douglas Khan Yunis, Gaza  No.2562597 


Porkistan ANUSOID Newark, Ostrobothnia  No.2562601 +1 

>>2562596
I haven't had to use one yet

Sweden Proxy the swedish spreadsheeter  No.2562603 +1 

>>2562597
Say what you want I will probably never be rodi's level of programming expertise.

Rana is Punjabi name, but his photo shows Bengali sign.

Palestine, State of the palestinian horsecocker Khan Yunis, Gaza  No.2562608 +1 

>>2562603
ye he's bangladeshi

https://github.com/cheikhshift
here's a senegalese gopher

Palestine, State of the palestinian naked wtf Khan Yunis, Gaza  No.2562610 +1 

>>2562601
how u stream data

Sweden Proxy the swedish incel  No.2562614 +1 

>>2562608
Looking at Github profiles with a lot of repositories depresses me.

Sweden Proxy the swedish bsr  No.2562618 +1 

Anyone know how Software Defined Radio works in terms of Software? I can understand the electronics and communication because I studied that shit.

Palestine, State of the palestinian women's pussy Khan Yunis, Gaza  No.2562620 +1 

>>2562614
some of them are just full of unmodified forks

this guy's legit tho

at least from a cursory glance

i looked at some of his repos and thought "ok cool, but why?"

Sweden Proxy the swedish bluepilled cuck  No.2562626 +7 

>>2562620
Yeah I have such forks too and I look like a retard with those.

I checked his company.I don't understand anything, I now understand what Kotia feels like when he sees scientific phenomenon, he thinks it's crystals and shiet.

Porkistan ANUSOID Newark, Ostrobothnia  No.2562634 +1 

>>2562610
If you mean streaming in the networking sense, I'm not working on that yet. I just have a stream of PCM data going directly to stdout and I'm piping it into sound programs to test it

Palestine, State of the palestinian morty Khan Yunis, Gaza  No.2562651 +1 

>>2562634
i meant that you're using an interface (io.Reader etc.)

btw you can use io.Pipe and you can have a goroutine with an exec.Command from os/exec to do everything you would've done in shell

like this example is a bit different, in this case when someone is uploading a file i'm immediately piping it as it uploads to sha1, sniffing its MIME type, redirecting it to ffprobe/ffmpeg if it's audio or video (i could use libav* bindings for go but i'd rather keep it pure go, without the added Cgo overhead) etc.

here i pipe the stdout of ffprobe to another pipe that unmarshals the json into a struct

package file

import (
"bronnen/config"
"bronnen/schema"
"context"
"golang.org/x/sync/errgroup"
"io"
"os"
"os/exec"
"syscall"
)

func probe(ctx context.Context, src io.Reader) (*schema.ProbeData, error) {

grp, ctx := errgroup.WithContext(ctx)

cmd := exec.CommandContext(ctx, config.FFprobeBinPath,
"-hide_banner",
"-loglevel", "fatal",
"-show_error",
"-show_format",
"-show_streams",
"-print_format", "json",
"-i", "-")

stdin, err := cmd.StdinPipe()
if err != nil {
return nil, err
}

probeDataR, probeDataW := io.Pipe()
cmd.Stdout = probeDataW

grp.Go(func() (err error) {
_, err = io.Copy(stdin, src)
if err == nil {
return stdin.Close()
}
if e, ok := err.(*os.PathError); ok && (e.Err == syscall.EPIPE || e.Err == os.ErrClosed) {
err = nil
}
return
})

data := &schema.ProbeData{}
grp.Go(func() (err error) {
if err = data.Decode(probeDataR); err != io.ErrClosedPipe {
probeDataR.CloseWithError(err)
}
return
})

grp.Go(func() (err error) {
err = cmd.Run()
if _, ok := err.(*exec.ExitError); ok {
err = nil
}
probeDataW.CloseWithError(err)
return
})

err = grp.Wait()

return data, err
}

Finland the finnish alcoloser Oulu, Pohjois-Pohjanmaa  No.2562669 +6 

israel mod

you were right: arabic is such a pilled language

Palestine, State of the palestinian schizo Khan Yunis, Gaza  No.2562673 +1 

>>2562669
Correct.

Palestine, State of the palestinian shemale Khan Yunis, Gaza  No.2563316 +1 

bump

United States Unskilled Laborer Reston, Virginia  No.2563320 +1 

>>2563316
Thanks

Palestine, State of the palestinian normalfag Khan Yunis, Gaza  No.2563321 +1 

>>2563320
your welcome

Finland the finnish lola Oulu, Pohjois-Pohjanmaa  No.2563682 +2 


Palestine, State of the palestinian lola Khan Yunis, Gaza  No.2563980 +2 


Germany the german reddit suede Netze, Niedersachsen  No.2563992 +2 

watch me code like a god by pointing a gun @ youre heads

United States the american moralfag Bellevue, Washington  No.2564046 +2 


Brazil admin Sao Paulo, Sao Paulo  No.2564397 +2 


Finland the finnish spreadsheeter Karkkila, Uusimaa  No.2564405 +1 


Palestine, State of the palestinian chad Khan Yunis, Gaza  No.2564916 +1 

>>2557594
used this line verbatim on my dad today

Sweden Proxy the swedish madarchod  No.2565004 +2 

>>2564916
Aren't you doing your degree or something?

Palestine, State of the palestinian kid rater Khan Yunis, Gaza  No.2565005 +1 

>>2565004
i graduated

Porkistan ANUSOID Newark, Ostrobothnia  No.2565422 +3 

File: 1539125885404.jpg (465.4 KB, 800x800, ebinnnnn.jpg) ImgOps Exif Google

>mechanism for transferring arbitrary structs between network connections in standard library

Ok, this is epic

Palestine, State of the palestinian lolicon Khan Yunis, Gaza  No.2565433 +1 

>>2565422
encoding/gob?

United States the american stable genius New Berlin, Wisconsin  No.2565438 +4 

File: 1539126272983.mp4 (3.84 MB, 640x360, HACKING the MAINFRAME.mp4) ImgOps Google

skimming this thread got me like

Palestine, State of the palestinian warehouse Khan Yunis, Gaza  No.2565439 +1 

i really really really like the go standard library

i'd rather implement everything myself than rely on a 3rd party package,,,

Palestine, State of the palestinian african american Khan Yunis, Gaza  No.2565442 +1 

>>2565438
jealous?

Porkistan ANUSOID Newark, Ostrobothnia  No.2565445 +1 

>>2565433
yes hon

Palestine, State of the palestinian faggot gay homo Khan Yunis, Gaza  No.2565446 +1 

>>2565445
(based google)

Porkistan ANUSOID Newark, Ostrobothnia  No.2565450 +1 

>>2565446
Based Rob Pike
(fuck googli)

Palestine, State of the palestinian neurotypical Khan Yunis, Gaza  No.2565457 +1 

>>2565450
don't forget based ken ass well,,,

Porkistan ANUSOID Newark, Ostrobothnia  No.2565458 +1 

>>2565457
based…

Porkistan ANUSOID Newark, Ostrobothnia  No.2565461 +2 

>>2565438
You've had how many years to learn AutoLisp now?
And you've squandered them.

Palestine, State of the palestinian brother Khan Yunis, Gaza  No.2565462 +2 

>>2565461
wacky is not the kinda n-word to strive to improve ximself, especially not for his job's sake,,,

Germany the german gayboy Munich, Bayern  No.2565471 +6 

File: 1539127354367.png (438.27 KB, 640x640, hat3.png) ImgOps Google


Palestine, State of the palestinian beanchad Khan Yunis, Gaza  No.2565477 +3 

>>2565471
when are you joining team Go pmf ?_?

United States the american stable genius New Berlin, Wisconsin  No.2565486 +1 

>>2565461
>>2565462
we outsourced our automation

Palestine, State of the palestinian 8channer Khan Yunis, Gaza  No.2565967 +1 


United Kingdom 𝔤𝔦𝔫𝔤𝔢𝔯 London, England  No.2565975 +1 

File: 1539143553935.jpg (94.39 KB, 640x560, hipster frog.jpg) ImgOps Exif Google

>>2565973

Palestine, State of the palestinian hideloc american Khan Yunis, Gaza  No.2568819 +1 

File: 1539276240227-0.png (34.83 KB, 317x220, me massager.png) ImgOps Google

File: 1539276240227-1.png (34.83 KB, 317x220, me meassager.png) ImgOps Google

File: 1539276240227-2.png (34.83 KB, 317x220, me massage.png) ImgOps Google

puppy found out someone did a side project very similar to mine like 3 years ago (also in go)

it's shit tho

Piteå's cranium Proxy the schizophrenic mudžahid Piteå's cranium  No.2568821 +2 

>>2568819
you should use Go to speed up the LHC computations.

Palestine, State of the palestinian naked wtf Khan Yunis, Gaza  No.2568824 +2 

>>2568821
they use a low-level programming language that has better performance

Porkistan ANUSOID Newark, Ostrobothnia  No.2569543 +2 

File: 1539307405283.jpg (12.8 KB, 496x368, cry.jpg) ImgOps Exif Google

>./main.go:37:9: too many errors

Palestine, State of the palestinian albert einstein Khan Yunis, Gaza  No.2569592 +2 

>>2569543
do you use an IDE or you just hack it on vim or w/e

Palestine, State of the palestinian burger flipper Khan Yunis, Gaza  No.2569593 +2 

made some nice progress today

Porkistan ANUSOID Newark, Ostrobothnia  No.2569611 +2 

File: 1539310751649.jpg (40.42 KB, 276x276, xDDDDD.jpg) ImgOps Exif Google

>>2569592
I just use vim for everything. I'm too used to it after 10 years to change to anything else.
Also my computers are to slow to run anything else LOL

I have never had a problem just using command line compilers, debuggers, profilers anyway. All the errors are gone now

Canada the canadian lund swede Montreal, Quebec  No.2569613 +3 

I fucking love feeling productive

Palestine, State of the palestinian autist dog Khan Yunis, Gaza  No.2569621 +1 

>>2569611
scrolling up and down and going back and forth fixing shit is p. gay but you're most efficient at what your used to i guess…

i love the Goland (IntelliJ) IDE

i used to do a lot of shit in the command line but every time i discover some new IDE feature that makes life easier,,,

Porkistan ANUSOID Newark, Ostrobothnia  No.2569624 +1 

>>2569621
>scrolling up and down and going back and forth fixing shit is p. gay
Do you have some kind of magic BBC program that shows everything at once?_?

Palestine, State of the palestinian cuckservative Khan Yunis, Gaza  No.2569628 +1 

>>2569624
well you can split shit around and actually see most everything you need but it gets congested and i have some trouble focusing on a single part

but that's not what i meant

since go is a type safe compiled language, the IDE knows if something (compile-time) is wrong immediately and you can fix it right there and then

complicated (as in not simple stuff like nil pointer dereference or slice index out of bounds) runtime debugging is trickier but the debugger interface is pretty nice

also it auto-saves which is nice (and obviously has local history)

Porkistan ANUSOID Newark, Ostrobothnia  No.2569652 +1 

>>2569628
I just look at the line numbers off the errors

then
:<line number>
*fix's*
and recompile

Australia the australian neghole pozzer Sydney, New South Wales  No.2569656 +2 

>>2569621
+1 goland is good

Australia the australian pizza boy Sydney, New South Wales  No.2569672 +2 

>>2569652
you can get IDE's for strong typed languages that run a little interpreter in the background (like ghci) and essentially find all your errors as you code it, like scripting or java

it speeds things up so much because you essentially compile and it just werks first time

Porkistan ANUSOID Newark, Ostrobothnia  No.2569698 


Finland the finnish witzig junge Oulu, Pohjois-Pohjanmaa  No.2569873 


Palestine, State of the palestinian brother Khan Yunis, Gaza  No.2571417 +1 

File: 1539389196736.png (375.38 KB, 810x767, VfKB7Zuq-a60Ke7nzOWZxu0rjf….png) ImgOps Google


Porkistan ANUSOID Newark, Ostrobothnia  No.2571724 +3 

File: 1539396527860.gif (79.79 KB, 180x180, shake.gif) ImgOps Google

> -race compile flag
absolutely epic
it's like they thought of everything

Porkistan ANUSOID Newark, Ostrobothnia  No.2575335 


Palestine, State of the palestinian hussy Khan Yunis, Gaza  No.2575365 


Palestine, State of the palestinian behindert Khan Yunis, Gaza  No.2578744 


Sweden Proxy the swedish pleb  No.2578772 +2 

Anus Rodi and Ronen jerk off each other while conversing about Golang schizo programming.

Palestine, State of the palestinian kid rater Khan Yunis, Gaza  No.2578811 

>>2578772
want to join us?

Porkistan ANUSOID Newark, Ostrobothnia  No.2578947 

>>2578772
>>2578811
cmooooon iiinnn

Palestine, State of the palestinian gayboy Khan Yunis, Gaza  No.2581194 +1 

almost finished with my side project

in fact the part relevant to bron c2 has been done'd already but i must present it to the open source community at large with an MIT license,,,

Palestine, State of the palestinian tranny lover Khan Yunis, Gaza  No.2583609 

finished it yesterday

now the not so fun part

(documentation)

Porkistan ANUSOID Newark, Ostrobothnia  No.2584492 

>>2583609
the side proj or bron v2?_?

Canada the canadian chadcel Quebec, Quebec  No.2584510 

File: 1539992418019.jpg (86.16 KB, 547x600, 1509486536024.jpg) ImgOps Exif Google

when a young n-word you know tells you he's getting an internship in Google

United States the american diaperfur fetishist Minneapolis, Minnesota  No.2584547 +3 

>>2584510
programminig is for pretentious toxic losers

Palestine, State of the palestinian amber Khan Yunis, Gaza  No.2584549 

>>2584492
side proj

it's done

everything is done

Sweden the swedish nippr daemon Linkoping, Ostergotlands lan  No.2584562 

First time i see a 3d engine running in the browser.
It is written i type script and it looks pretty promising tbh.

Palestine, State of the palestinian 8channer Khan Yunis, Gaza  No.2584565 

>>2584562
uhhh unity?

nowadays webassembly 3d browser web apps/games are ubiquitous

United States Tax Fetishist Reston, Virginia  No.2584571 +1 

>>2584547
And this thread is a good example!
Hahaha!

United States the american blöndal Minneapolis, Minnesota  No.2584574 

>>2584571
hmmm based

Sweden the swedish cbronnenite Linkoping, Ostergotlands lan  No.2584591 

>>2584565
ah look at that, this shit is old then

Canada the canadian rex Quebec, Quebec  No.2584600 +1 

I'm sorry did someone hear a non-college-educated opinion?

Porkistan ANUSOID Newark, Ostrobothnia  No.2584604 

>>2584510
my sisters boyfriend works at Googli (war criminal)

Palestine, State of the palestinian pizza boy Khan Yunis, Gaza  No.2586163 +1 

File: 1540064256285.mp4 (67.22 KB, 320x240, Teşekkür Ederiz.mp4) ImgOps Google

based turkish devkev starred my repo

thank you pmf

Palestine, State of the palestinian christcuck Khan Yunis, Gaza  No.2586868 


United States the american täby Slidell, Louisiana  No.2586924 +2 

let this damn thread die

United States the american bronze gentleman Minneapolis, Minnesota  No.2587166 

>>2584600
i'm sorry i realize the irony nao

Sweden Proxy the swedish nerd  No.2587182 +2 

>>2586163
I wantt to star it too, but I have my name on it.

Palestine, State of the palestinian gwen Khan Yunis, Gaza  No.2587187 

>>2587182
ty bro i understand

Palestine, State of the palestinian naked wtf Khan Yunis, Gaza  No.2589125 

https://github.com/dudk/phono

relevant to your project?

(using 3rd party libs for a portfolio project is kinda gay though)

Porkistan ANUSOID Newark, Ostrobothnia  No.2589136 

>>2589125
All the low level sound stuff I'm definitely doing myself. That's where all the fun is.

Porkistan ANUSOID Newark, Ostrobothnia  No.2589154 

File: 1540177139957.png (377.35 KB, 570x427, image.png) ImgOps Google

I should have stayed in Japan and unironi tried to get a job with Korg or Roland or Yamaha. Like Im not a DSP pro but there would be something to do with my Japanese + synthesis + programming knowledge

Instead Im probably gonna work at some cuckson marketing firm in Melbourne writing spyware shit in javasoy

Palestine, State of the palestinian neurotypical Khan Yunis, Gaza  No.2589162 

>>2589154
yep

retard ditch your vagi and cum back to hi no moto

Palestine, State of the palestinian summerfag Khan Yunis, Gaza  No.2589179 

>>2589167
>I don't have any knowledge to subject of this thread
hmm if only there were a certain method to rectify this

hmm

Porkistan ANUSOID Newark, Ostrobothnia  No.2589186 +1 

>>2589162
There literally desparate for English speaking programmers in Kyushu
The average Western soylet doesnt think anything even exists outside Tokyo and maybe Osaka
My Afri friend was doing some bullshit Python gig in big FUKy and he had so much money he was thinkeng about starting his own company (and getting perma residence)
I could have lived very comfortably

But I think Australi will be good to me. This is the path that we romantic warriors must tread…

Palestine, State of the palestinian sissy hunter Khan Yunis, Gaza  No.2589192 

>>2589186
so you left all your dreams behind for a vagi

gay as shit…

this does NOT speak to a greater bronnarrative

Sweden Proxy the swedish mammal  No.2589194 

>>2589192
I bet you will go and ldar in Ukraine for a vagi too.

Palestine, State of the palestinian magapede Khan Yunis, Gaza  No.2589199 

>>2589194
>Ukraine
ldar the countryball

>Ukrainian tradwife

mayhaps…

Porkistan ANUSOID Newark, Ostrobothnia  No.2589207 +1 

File: 1540178157020.jpeg (41.5 KB, 538x404, image.jpeg) ImgOps Google

>>2589192
Unironically yes
If I werent in a relationshit I'd 100% just stay in Japan. It'd be easy enough to get hired with my level of Japanese + native English + skills and the cost of living is soooo cheap (howls)

But maybe its good that Im not. Theres something profoundly macabre about Westerners who live in Japan forever

Palestine, State of the palestinian kid rater Khan Yunis, Gaza  No.2589219 

>>2589207
>Theres something profoundly macabre about Westerners who live in Japan forever
yes but then again is it really a good excuse

destroying it all (beta leftists) for a vagi that doesn't even know about goatse

Porkistan ANUSOID Newark, Ostrobothnia  No.2589235 

>>2589219
Shes a nice girl. Ive had various gfs but shes the only one who understands the essence of being an ironycel. I wouldnt move around the world if I didnt believe…

Brazil admin Sao Paulo, Sao Paulo  No.2589238 

>>2589186
bronn llc in kyushu when?

Porkistan ANUSOID Newark, Ostrobothnia  No.2589241 

>>2589238
Think:
Israel mod
A retarded manchild with a moustache
And an African guy obsessed with self help books

Itll be epic

Sweden Proxy the swedish natsoc gfur  No.2589246 

From Golang to relationship in one thread

Palestine, State of the palestinian pepe garrison Khan Yunis, Gaza  No.2589252 


Brazil admin Sao Paulo, Sao Paulo  No.2589253 

>>2589241
recipe for a epic win

Brazil admin Sao Paulo, Sao Paulo  No.2589257 

>>2589241
what areas theyre in most need in japan
thinking about something here

Porkistan *tents fingers* ANUSOID Newark, Ostrobothnia  No.2589259 +1 

I still have the funds for a business visa in Japan
If Australi doesnt work Ill be in touch….

Sweden Proxy the swedish rick  No.2589269 +2 

>>2589259
Fund Porkistanis instead for bombing yourself.

Palestine, State of the palestinian lumpenprole Khan Yunis, Gaza  No.2589279 

my dad's former co-worker's son who's 6 years younger than me has a multimillion dollar startup which is based in san francisco and has signed a major contract with Rakuten in july

we were in the same company trip to cyprus when i was a kid

lol

Palestine, State of the palestinian albert einstein Khan Yunis, Gaza  No.2589281 

he's also a thiel fellow and was featured in a forbes list

Palestine, State of the palestinian morty Khan Yunis, Gaza  No.2589286 

>>2589284
nice google fu

Palestine, State of the palestinian minimum wage Khan Yunis, Gaza  No.2589289 


Palestine, State of the palestinian warehouse Khan Yunis, Gaza  No.2589291 

>>2589290
ye no shit i don't mind

Sweden Proxy the swedish kid napper  No.2589292 +1 


Palestine, State of the palestinian lolicon Khan Yunis, Gaza  No.2589293 

>>2589292
he's dad is loaded yeah, but that doesn't mean it's not impressive

Sweden Proxy the swedish brother  No.2589294 

>>2589289
I wanted to buy some original Japanese Udon and Ramen or at least the flour to make such, but I gave up when every fucking thing is in Japanese and is more confusing than Alibaba/Aliexpress.

United States the american neurotypical (muokattu) Minneapolis, Minnesota  No.2589295 


Brazil admin Sao Paulo, Sao Paulo  No.2589302 

should i jump on the golang bandwagon?

Sweden Proxy the swedish hiv carrier  No.2589305 

>>2589302
Choose language based on what you want to do. Not on bandwagons.

Although experienced technologists will say start with C and C++

Palestine, State of the palestinian staffas Khan Yunis, Gaza  No.2589313 

>>2589302
didn't you already start learning it a while ago

Sweden the swedish douglas Linkoping, Ostergotlands lan  No.2589316 

>>2589305
greger min neger
köttar du kth?

Sweden Proxy the swedish neghole pozzer  No.2589317 

>>2589316
What is this alt shit language?

Bitch speak English.

Brazil admin Sao Paulo, Sao Paulo  No.2589318 

>>2589313
yeah
but i just started and got busy with other stuff

Brazil admin Sao Paulo, Sao Paulo  No.2589320 

>>2589305
golang is related with backend processes for servers, so im kinda interested in that

Sweden the swedish kekistani Linkoping, Ostergotlands lan  No.2589321 

>>2589317
ah thought u were piteå

Porkistan ANUSOID Newark, Ostrobothnia  No.2589336 

>>2589305
>start with C
Thats stupid
Everybody should know C, since thats how computers work, but nobody should learn C first, since it makes you think like a computer

I wouldnt even recommend Go as a starting point as much as I like it. It's still too mechanical. Computer science should have no concern for memory, number size, etc

People should unironi learn Python or Scheme first.

Switzerland Proxy the swiss unkel Glattfelden, Zurich  No.2589358 +1 

i love to program!

United States the american neghole pozzer Rockville, Maryland  No.2589359 

nerds

Brazil admin Sao Paulo, Sao Paulo  No.2589362 


Porkistan ANUSOID Newark, Ostrobothnia  No.2589372 

>>2589362
Is very good (more than a meme, a legend)
If nothing else read the first two chapters for the essence of functional programming
The others are very interesting but less important

Brazil admin Sao Paulo, Sao Paulo  No.2589389 

>>2589372
i see
i was learning python and data science
but i got pissed because most of that shit was used to predict stock prices

Turkey the turkish sissy hunter Istanbul, Istanbul  No.2589479 

File: 1540196749146.jpg (116.92 KB, 700x525, finn TV.jpg) ImgOps Exif Google

>>2565477
cant use no meme language anymore

Sweden Proxy the swedish hetloser  No.2589487 

>>2589389
Data science is more like a new word, most of the people in science and engineering already do it, but at a small scale.

I guess you want to do something with backend? I think the route of Go and maybe if you think it's difficult, Node.js is better.

Palestine, State of the palestinian paintknight Khan Yunis, Gaza  No.2591088 

fuck cgo

Porkistan ANUSOID Newark, Ostrobothnia  No.2591291 

>>2591088
*comes up behind you and massages your shoulders a bit*
something wrong hon?

Finland the finnish dogfucker Vaasa, Pohjanmaa  No.2591331 +4 

fuck csgo

Palestine, State of the palestinian bulge noticer Khan Yunis, Gaza  No.2591540 

>>2591291
actually fuck libav

i wasted 6 hours debugging and rewriting a sizeable portion of the code in C because a certain flag would cause av_open_input to get stuck in an endless loop but if you set it to 0 it works correctly

and you can't debug cgo worth shit

yet the documentation says the flag i set is correct and you can find the same in other projects

maybe it's just a 4.0.2 bug

Armenia the armenian täby Yerevan, Erevan  No.2591560 +1 

>>2589562
i have actually read all of this and fapped to it

United Kingdom bateman Carluke, Scotland  No.2592017 +1 

me new company codebase is so fucked up the lead guy said it takes a year to learn how to add new features to it properly
they act really surprised every time you manage to finish a set task
usually i solve most of the problem and then just delete or rewrite the tests that show it isnt finished yet

Palestine, State of the palestinian mod Khan Yunis, Gaza  No.2592050 +2 

File: 1540329174738.png (233.85 KB, 500x500, ClipboardImage.png) ImgOps Google

>>2592017
hmm based

Sweden vastra Malmoe, Skane lan  No.2592067 


Germany the german minimum wage Darmstadt, Hessen  No.2592071 

>>2592050
i handed over some code to an intern today and he was blown away when i told him what the tests were for

this is why i upvote le meme!

Palestine, State of the palestinian normalfag Khan Yunis, Gaza  No.2592105 

>>2592071
assgaypissm pro have you finished your degree already

Palestine, State of the palestinian cuckservative Khan Yunis, Gaza  No.2592112 

>>2592071
assgaypissm pro how is your manjaro kde installation progress

Germany the german summerfag Darmstadt, Hessen  No.2592131 

>>2592112
im using it with xfce since over half a year

>>2592105
after the degree is before the next
im looking @masters programs

are you putting this into the bronnen poster spreadsheet
if so i know a vim-based spreadsheet editor you may be interested in…

United States the american women worshipper Bellevue, Washington  No.2592134 

>>2592131
>xfce
i'd say based if i knew how to use it (i dont)

Palestine, State of the palestinian madarchod Khan Yunis, Gaza  No.2592138 

>>2592131
masters programs are for gay ppl

hence i will be applying to one too

Germany the german autistic shoes Darmstadt, Hessen  No.2592142 +3 

File: 1540332600290.jpg (13.97 KB, 249x255, 1540004005540.jpg) ImgOps Exif Google

>>2592134
thanks!

>>2592138
VERY good
i'll talk 2 u in 2 years when we both apply for open PhD positions

Palestine, State of the palestinian autist dog Khan Yunis, Gaza  No.2593619 

me side project was added to awesome-go

nice

current settis: devkeving in C (libav*, libvips etc. for bronn v2 thumbnails)

Turkey the turkish pizza boy Istanbul, Istanbul  No.2593639 

>>2593619
kill yourself this moment chad

Palestine, State of the palestinian autistic shoes Khan Yunis, Gaza  No.2593676 

>>2593639
come to golang stables or i kill myself

Porkistan ANUSOID Newark, Ostrobothnia  No.2593991 

>>2593619
Whos awesome go patrik
One of your shinzonas?

United Kingdom bateman Alfreton, England  No.2595025 +1 

>>2592050
guy with 20 arms and light rays shooting out of brain sitting on cosmic dust cloud tier: the function determines the function signature it was called with by appending the function arguments to the function name and then greps the function signature from the root directory to find the test file and function it was called from and scans the text to find what value its supposed to return in the assert call and then returns that value

Palestine, State of the palestinian northern brother Khan Yunis, Gaza  No.2596788 

epic progress

Finland the finnish curitiba Oulu, Pohjois-Pohjanmaa  No.2596800 +5 

File: 1540594116741.mp4 (2.33 MB, 436x704, paintjob.mp4) ImgOps Google


Palestine, State of the palestinian leafchad Khan Yunis, Gaza  No.2598349 +1 

powerful

Brazil admin Sao Paulo, Sao Paulo  No.2598363 

>>2598349
can we have some updates about ur progress

Palestine, State of the palestinian pissbottle drinker Khan Yunis, Gaza  No.2598405 

>>2598363
i've finished the representative video frame/cover art extraction (as raw packed rgb/rgba data) portion of the bronn v2 thumbnailer in C and linked it with go (via cgo)

spent the last few days devkeving in C and it's so powerful but i've missed go and not having to run 5 different sanitizers/valgrind etc.

i still need to write the image thumbnailing portion in C

and of course compression

Palestine, State of the palestinian 8channer Khan Yunis, Gaza  No.2598411 

>>2598399
puppy needs to start a patreon unironically,,,

family (especially the grandmas) are pressuring me to find a job and earn money and trolling me for doing nothing (they don't know how hard i'm working (for free))

if i get a job prematurely it'll be the end of bronn v2

Brazil the brazilian pmf Sao Paulo, Sao Paulo  No.2598416 

>>2598405
So, youre building everything from scratch literally?

Brazil the brazilian rick Sao Paulo, Sao Paulo  No.2598418 

>>2598411
Say to them that Jobs are for losers and that youre a digital entrepeneur

Palestine, State of the palestinian hideloc american Khan Yunis, Gaza  No.2598439 

File: 1540689745603-0.png (154.81 KB, 1053x911, ClipboardImage.png) ImgOps Google

File: 1540689745603-1.png (3.58 KB, 257x257, ClipboardImage.png) ImgOps Google

File: 1540689745603-2.png (53.49 KB, 640x720, ClipboardImage.png) ImgOps Google

>>2598416
well not from scratch but pretty low level

i use the ffmpeg library extensively

for example this creates a color/alpha histogram of an arbitrary pixel format with arbitrary bit depth and arbitrary packing/planar configuration

so it works for rgba (say a png with transparency), yuv420p (y is luma, uv are chroma, the numbers are indicate how many bytes per pixel (bit depth and chroma subsampling), how 99.9% of videos and jpegs are packed, look it up), yuva420p, yuv444p etc., monochrome bitstream format (0 for black 1 for white, how squid.png looks when unpacked) etc.

some formats are packed (first pixel is the first n bytes representing bit depth) some are planar (first is the luma channel, then the two chrome channels etc.)

with some formats that aren't 8-bit (like squid.png which is 1 bit bitstream) especially those that are over 8 bits but not a multiple of 8 like 10-bit have some packing funkiness to maximize utilization of processor wordsize (64-bit for amd64) and advanced instruction sets like AVX2, AVX512 etc used to encode/decode video, and of course hardware acceleration intended pixel formats (there is a specialized pixel format for CUDA for instance)

also stuff over 8 bits has to deal with endianness

this actually didn't require a lot of work thanks to ffmpeg, specifically libavutil/pixdesc.h that has some tools to deal with all this stuff

Brazil the brazilian drumpf Sao Paulo, Sao Paulo  No.2598449 

>>2598439
What editor are u using? Atom or sublime text?

Finland kotiakrobaatti Vantaa, Kanta-Hame  No.2598452 

>>2598449
hes using netbeans ide…

Palestine, State of the palestinian bigdickbitch Khan Yunis, Gaza  No.2598453 

File: 1540690316858.png (12.62 KB, 632x75, ClipboardImage.png) ImgOps Google

>>2598449
CLion for C, Goland for Go

i've seen these with 5GB combined memory usage

the reason for this is that all of the include headers and C/go source code on my computer is indexed

and i have tons of it (mostly because i'm on linux and i have tons of shit installed and everything comes with its own library)

Palestine, State of the palestinian chad Khan Yunis, Gaza  No.2598457 

i'm doing video shit

anus rodi is doing audio shit

funny how life works

Brazil admin Sao Paulo, Sao Paulo  No.2598498 

>>2598453
sublime text is actually very lightweight
it runs pretty smooth on my old thinkpad laptop

Brazil admin Sao Paulo, Sao Paulo  No.2598499 +1 

>>2598457
and i just took a shit

coincidence?

Palestine, State of the palestinian 4channer Khan Yunis, Gaza  No.2598501 

>>2598498
my 7 year old pc has 16gb of ram and an i7-2600k (basde future proofing) so performance/weight isn't an issue

it's all about what the IDE can provide for you in return

and sublime (which isn't even an IDE) has very little to offer

Brazil admin Sao Paulo, Sao Paulo  No.2598504 

>>2598501
i dislike the main idea behind IDEs and prefer text editors

Palestine, State of the palestinian kermode Khan Yunis, Gaza  No.2598510 

>>2598504
might as well forgo sanitizers, profilers, memory leak detectors, static analyzers, formatters, linters and build tools

Brazil admin Sao Paulo, Sao Paulo  No.2598513 


Sweden Proxy the swedish zinger  No.2598548 

Hey guys, I'm trying to understand how programmers work, because I don't really have a project in my mind right now, I did this stupid copy-paste from Github project of this thing called SLAM(from ROS library) in my undergrad, which this Comma.ai guy is trying to build from scratch in this video. Can you comment on his coding style?

United States the american staffas Minneapolis, Minnesota  No.2598570 


Sweden Proxy the swedish livebunkerer  No.2598879 


Porkistan ANUSOID Newark, Ostrobothnia  No.2601216 +3 

squid mentioned

Palestine, State of the palestinian african american Khan Yunis, Gaza  No.2601221 

>>2601216
VERY important image

Porkistan ANUSOID Newark, Ostrobothnia  No.2601225 

My girlfriend is staying here for a while and I cant program
(We LOVE to travel)
Keep this thread bumped

Palestine, State of the palestinian kermode Khan Yunis, Gaza  No.2601243 +6 

>>2601225
problematic

Canada the canadian junge Quebec, Quebec  No.2601259 +6 

>>2601225
delete this thread

Palestine, State of the palestinian women worshipper Khan Yunis, Gaza  No.2603616 


Sweden Proxy the swedish opfer  No.2603620 

>>2603616
Go there with bronnen poster

Also insert a slide about bronnen if you are going as speaker.

Palestine, State of the palestinian pmf Khan Yunis, Gaza  No.2603622 

>>2603620
hmmmmmmm

Sweden Proxy the swedish kiribati  No.2603626 

>>2603625

Brazil admin Sao Paulo, Sao Paulo  No.2604663 


Denmark the danish lucas bailey Copenhagen, Hovedstaden  No.2604677 

>>2603626
Yikes, this guy is pretty cringe.

Palestine, State of the palestinian pizza boy Khan Yunis, Gaza  No.2605610 

hmmm based

Palestine, State of the palestinian modi chaiwala Khan Yunis, Gaza  No.2607532 

continuous integration with 10+ pkg-config dependencies

eeeaaaa

guess i should finally learn how to make a docker image with all the shit i need

Sweden Proxy the swedish curitiba  No.2607553 

>>2607532
I remember using Docker, I don't know for what though, I was fidgeting with a lot of things, including React Native app hosted on Heroku, I should have continued toying around instead of just learning basic shit being in n00bdom. I should have built a basic app long time ago.

Brazil admin Sao Paulo, Sao Paulo  No.2607556 

>>2607553
you only learn by doing shit
those niggers that only teach the basics never left academia or are mediocre coders

also, the basics are usually the same shit

Sweden Proxy the swedish virgin  No.2607558 

>>2607556
>you only learn by doing shit
True

>those niggers that only teach the basics never left academia or are mediocre coders

Same shit I thought about the other day. I mean, the people I have been watching are not great programmers, they are just good at teaching.

Brazil admin Sao Paulo, Sao Paulo  No.2607560 

>>2607558
there are some teachers that are good programmers
but these are usually honest and say that doesnt matter the language you pick, the fundamentals are the same and as soon as you have a solid knowledge of fundamentals you should just have to start to build useful shit that can be used in real world

Sweden Proxy the swedish puppy  No.2607565 +2 

I unironically want to thank Anus Rodi for making this thread. And FM for keeping it alive by bumping it with his update. Never enjoyed a thread so much even though I don't know anything about Go.

Sweden Proxy the swedish rex's owner  No.2607570 

>>2607560
The problem is that I fear failure so much that I don't even want to do anything.

Brazil admin Sao Paulo, Sao Paulo  No.2607589 

>>2607570
you wont lose anything if you fail plus youll learn everytime you make a mistake
you can also modify other peoples code adding features or fixing bugs

Palestine, State of the palestinian unkel Khan Yunis, Gaza  No.2607774 +2 

uploaded ironic gay porn on github

United States the american cam fapper Chicago, Illinois  No.2607952 

Good pic

Porkistan ANUSOID Newark, Ostrobothnia  No.2610942 


Brazil admin Sao Paulo, Sao Paulo  No.2611304 


Germany the german pizza Darmstadt, Hessen  No.2611353 

>>2592071
update on this nogga:

after 2 weeks of debugging he decided to go back to a backup from a month ago (he is NOT using version control)

imagine two weeks of not advancing in solving a problem at all

Brazil admin Sao Paulo, Sao Paulo  No.2611393 

>>2611353
>imagine two weeks of not advancing in solving a problem at all
the history of my life

Germany the german minimum wage Darmstadt, Hessen  No.2611413 

File: 1541368517783.jpg (711.84 KB, 1200x1600, 1327349618088.jpg) ImgOps Exif Google

>>2611393
sorry to hear :/

Palestine, State of the palestinian stem masterrace Khan Yunis, Gaza  No.2612084 

>>2611353
wtf macabre

i "wasted" yesterday on fiddling with docker and alpine linux

i gave up on alpine linux because it lacks fundamental features in the libc it comes with and a smaller image isnt worth the extra hassle

but ive pretty learned everything i need to solve my current "problem"

i'll just stick with ubuntu for my containerisation needs i think

Seychelles Proxy the seychellois einor hugji Victoria, English River  No.2612086 

>>2612084
alphine's for running nodes and reverse proxs

Palestine, State of the palestinian summerfag Khan Yunis, Gaza  No.2612094 

>>2612086
alpine is for any type of minimalistic linux installation and it's used mainly with docker (to better scale horizontally)

Seychelles Proxy the seychellois ferenc fart Victoria, English River  No.2612108 

>>2612094
why did they killed him

do you have insider info

Palestine, State of the palestinian chadcel Khan Yunis, Gaza  No.2614426 +1 


Netherlands the swedish tamil man  No.2614628 

imagine reading this thread

Brazil admin Sao Paulo, Sao Paulo  No.2615006 +5 

>>2614628
imagine reading

Brazil admin Sao Paulo, Sao Paulo  No.2617306 


Porkistan ANUSOID Newark, Ostrobothnia  No.2619111 


India the indian natsoc gfur Mumbai, Maharashtra  No.2619139 

coroutines are redpilled

Palestine, State of the palestinian stablemaster Khan Yunis, Gaza  No.2620957 +4 

File: 1541833499744.png (6.63 KB, 340x67, ClipboardImage.png) ImgOps Google

hmmm based

United States the american pmf New Berlin, Wisconsin  No.2621757 

Good pic

Palestine, State of the palestinian pederast Khan Yunis, Gaza  No.2623735 +2 

epic

Brazil admin Sao Paulo, Sao Paulo  No.2624502 


Palestine, State of the palestinian claire Khan Yunis, Gaza  No.2625281 

anusoid are you making use of the net/rpc package

or are you just transferring raw gob encoded data via tcp ?_?

if you're using tcp and both the server/clients are on the same machine you should use unix domain sockets

their epic and much faster than tcp imma benchmark now

Palestine, State of the palestinian vaginigger Khan Yunis, Gaza  No.2625340 

throughput seems to be about the same (~1 GiB/s) when reading from a file on an SSD

the unix sockets are a bit faster but no more than 10%

and the latency for unix sockets is lower by about 20-30%

but other than that they're more or less equal because i'm buffering on the ssd instead of storing it all in memory

when i buffered the file to memory it was (1.515 GiB/s) for the unix socket, but remained 1 GiB/s for TCP

so a 50% increase

for small files/data the latency of the unix socket was half of the TCP's

this doesn't really add anything to my needs since i'm gonna be dealing with an outside connection capped to much less than 1 GiB and either way the latency is negligible

also it's much easier to do load balancing with a tcp port than with a socket file descriptor

maybe it'll suit your use case though (latency is much more important for real time audio playback than processing http requests)

Portugal the portuguese akainu Carnaxide, Lisboa  No.2625359 

>>2625340
Ronen do you have a girlfriend

Its for my school essay

Palestine, State of the palestinian pederast Khan Yunis, Gaza  No.2625362 

>>2625359
let me answer your question with a question:

does anusoid make money by ignoring guido on bronnen?

Portugal the portuguese telejerker Carnaxide, Lisboa  No.2625368 


Turkey the turkish beefer Alanya, Antalya  No.2625372 

>>2625340
ronen why u in gaza mashallah

Palestine, State of the palestinian orbi Khan Yunis, Gaza  No.2625373 

>>2625368
refer to >>>/vir/4479 for the definitive authority on the matter

>>2625372
https://www.ynetnews.com/articles/0,7340,L-5397926,00.html

can't tell you more

Portugal the portuguese spook Carnaxide, Lisboa  No.2625431 

>>2625373
Ntgger basterd

Palestine, State of the palestinian fedora atheist Khan Yunis, Gaza  No.2625433 

>>2625431
uhm what? hon i don't think we're communicating right

Palestine, State of the palestinian chadcel Khan Yunis, Gaza  No.2625435 

actually never mind it was my fuck up

he he he

United Kingdom the british curitiba Oxford, England  No.2625463 

fk u

Palestine, State of the palestinian spook Khan Yunis, Gaza  No.2625514 +1 

>>2625463
daunas makes money by receiving payment from guido in exchange for telling Anusoid to fuck himself on bronnen

Brazil admin Sao Paulo, Sao Paulo  No.2629715 


Germany the german women worshipper Darmstadt, Hessen  No.2629743 

>>2625340
benchmarks should be the next big meme on ylircleauta

United States the american kid sucker Bellevue, Washington  No.2629745 +1 

bad thread

Germany the german bearmode Darmstadt, Hessen  No.2629748 +4 

>>2629745
fuck you its actually very good

Palestine, State of the palestinian elagabalus Khan Yunis, Gaza  No.2633815 

page 33

Porkistan ANUSOID Newark, Ostrobothnia  No.2635130 


Brazil admin Sao Paulo, Sao Paulo  No.2635211 


Finland the finnish kid napper Vaasa, Pohjanmaa  No.2635591 


Dice rollRolled 1d10. Result: 9.

United States the american masturbati Fort Wayne, Indiana  No.2635701 +1 

Good pic

Porkistan ANUSOID Newark, Ostrobothnia  No.2638474 


Palestine, State of the palestinian only 96 Khan Yunis, Gaza  No.2639283 +1 


Palestine, State of the palestinian dogfucker Khan Yunis, Gaza  No.2639391 +4 

File: 1542654127246.jpg (51.77 KB, 960x436, z5-NDg95BrCv2V52v4NmiofmID….jpg) ImgOps Exif Google


Palestine, State of the palestinian women's pussy Khan Yunis, Gaza  No.2639397 +1 

File: 1542654268698.jpg (125.73 KB, 1140x813, ggwgRgm.jpg) ImgOps Exif Google


Germany the german cohen Darmstadt, Hessen  No.2639398 

bump for proper software documentation, usage examples and high test coverage including edge cases

Palestine, State of the palestinian pepe garrison Khan Yunis, Gaza  No.2639399 

File: 1542654394325.png (50.48 KB, 806x331, ClipboardImage.png) ImgOps Google


Germany the german adnan Darmstadt, Hessen  No.2639400 

>>2639397
< programming socks
:DDDDDDDDDDDDDDDDDD

Palestine, State of the palestinian smell Khan Yunis, Gaza  No.2639408 

File: 1542654543306.jpg (531.79 KB, 1575x1074, 45fyrocnadwx.jpg) ImgOps Exif Google

>>2639400
it's a /g/ meme

the algorithm probably fell for it

Porkistan ANUSOID Newark, Ostrobothnia  No.2639416 

>>2639397
I hate this meme
I hate fourchan /g/
I hate trannies

Palestine, State of the palestinian hacker Khan Yunis, Gaza  No.2639425 +1 

>>2639416
yeah same to be honest

Porkistan ANUSOID Newark, Ostrobothnia  No.2639438 

>>2639399
remember one of these faggots is the reason why we even have yli /int/ in the first place

Sweden the swedish hewat Linkoping, Ostergotlands lan  No.2639465 

>>2639408
I knew a duded who was a lisp faggot.

He was the weirdest motherfucker in a group of weirdos. He had a quasimodo back, he walked funnily and he could not keep his fucking mouth shut when eating, god damn lispfaggots are eating loud.

United States Pizza Fire Crisis Actor Center Moriches, New York  No.2639468 +4 

All programming is estrogen

Brazil the brazilian roy Sao Paulo, Sao Paulo  No.2639475 +1 

>>2639465
Invite him to bronnen

Palestine, State of the palestinian pepe garrison Khan Yunis, Gaza  No.2639479 +5 

>>2639438
based lambda

>>2639465
ah i see you've met my good friend anusoid

Porkistan ANUSOID Newark, Ostrobothnia  No.2639480 +3 

>>2639465
how did it feel knowing albert einstein?

Palestine, State of the palestinian summerfag Khan Yunis, Gaza  No.2639481 +1 

>>2639468
loathing stuff you don't understand is such a shirley thing

Russian Federation the russian anime pro Podol'sk, Moskovskaya oblast'  No.2639486 +2 

programming the plumbing of 21 century

Netherlands the swedish tamil man  No.2639488 

can we get some love for rust boys it's 2018 already
https://www.rust-lang.org/en-US/

Sweden the swedish behindert Linkoping, Ostergotlands lan  No.2639526 

>>2639480
He has programmed lisp since he was 15 or something, funnily enough everything he writes in racket schem just breaks since it is a dead language lmao

Porkistan ANUSOID Newark, Ostrobothnia  No.2639640 

>>2639486
I agree and thats good

>>2639526
scheme is infamously non portable
they have a standard but every community decides to implement 70% of it and then do other shite there own way

>>2639488
rust might be pilled too but for different reasons
pup pup made an oath to find a job first before he wastes time on anything else new

Palestine, State of the palestinian norgebosniak Khan Yunis, Gaza  No.2639657 

>>2639640
yea rust is better than go in certain problem domains and vice versa

it's all about the right tool for the job etc. yadda yadda

also it's literally a cargo cult :DD

Porkistan ANUSOID Newark, Ostrobothnia  No.2639677 +3 

>>2639657
hehe I get it brother

Palestine, State of the palestinian chadcel Khan Yunis, Gaza  No.2639685 

>>2639677
us programmers and our advanced humour only 150+ IQ geniuses will ever get, am i right brother?

Sweden vastra Malmoe, Skane lan  No.2639687 

>>2639657
>>2639640
heh yeah rust is such an epic game….

Palestine, State of the palestinian claire Khan Yunis, Gaza  No.2639695 +11 

>>2639687
remember when michael coats bought a copy of rust for dixie and ross so that they could play together with coats as the team leader and then they got pwned and griefed by some epic trolls after hours of work and coats blamed it on dixie because of his insubordination and smashed his laptop in anger and bricked the hdd that had important documents concerning a lawsuit against his university for wrongful expulsion?

United States the american autistic shoes Southaven, Mississippi  No.2639701 

>>2639695
you're muddling your backstories here
yes coats paypigged several copies of rust
and yes we did get epic owned by some russians
yes coats did have a rage fit that basically killed the game jerk over it
but that's not when the smashening occurred
the smashening occurred while we were playing payday 2
coats yet again nominated himself as the leader of the group
and yet again we were getting owned
dixie said something snarky to coats while he was anger, and the rest of the crew laughed (i forget who our 4th was, probably sandy or ross or maybe even adam?)
that's when the smashening occurred
and we never played payday 2 ever again

Palestine, State of the palestinian 4channer Khan Yunis, Gaza  No.2639712 +1 

>>2639701
oh right

i guess you had to be there hehehe

Palestine, State of the palestinian reptillian Khan Yunis, Gaza  No.2639721 +1 

btw i'm moving from encoding/gob and net/rpc to protobuf and gRPC

i apologise for this bethrayal, but, while elegant and low overhead, the former lacks many essential features for my use case,,,

United States the american speedrunner San Jose, California  No.2639742 +3 

File: 1542663759787.jpg (10.66 KB, 190x265, crey.jpg) ImgOps Exif Google

>>2639701
ameris are so scary

United States the american admin San Jose, California  No.2639747 +5 

File: 1542663820334.jpg (10.66 KB, 190x265, crey.jpg) ImgOps Exif Google

i retract meeting coats it dodnt happen i was safe @ home in cozi depressi no risk of america

Brazil admin Sao Paulo, Sao Paulo  No.2639748 +5 

>>2639701
>>2639695
lol
if youre angry just beat the shit out of your gf/wife
you wont break anything important if you do that

United States the american sonichu Saint Cloud, Minnesota  No.2639804 

>>2639742
What's scary about that
>>2639747
Rude

United States the american bsr Southaven, Mississippi  No.2639872 +1 

>>2639748
now coats has a gf who likes to be beaten so everybody wins

Brazil admin Sao Paulo, Sao Paulo  No.2643635 


Palestine, State of the palestinian aids boy Khan Yunis, Gaza  No.2646154 +1 


Palestine, State of the palestinian altshiter Khan Yunis, Gaza  No.2648688 +1 

fuck glibc malloc

tcmalloc is king

Palestine, State of the palestinian unkel Khan Yunis, Gaza  No.2649510 +1 

actually tbbmalloc is even better

United States the american pizza Virginia Beach, Virginia  No.2649534 +2 

File: 1543156421192.mp3 (3.98 MB, 255x255, all_by_myself.mp3) ImgOps Google


Porkistan ANUSOID Newark, Ostrobothnia  No.2651980 


Palestine, State of the palestinian niggersachsen Khan Yunis, Gaza  No.2651986 +1 


United States Osama's Fifth Wife Center Moriches, New York  No.2652001 +1 

>>2649534
>When I was young
>I never needed anyone
<Making love was
All music is satan

United States Osama's Fifth Wife Center Moriches, New York  No.2652005 +1 

File: 1543282728693.jpg (315.5 KB, 1464x2048, __iguchi_yuka_and_tone_kan….jpg) ImgOps Exif Google

Allllllllllll
byyyyyyyyyyyyyy
myyyyseeeeeeeeeeeeeelf
Don't wanna be
Allllllllllll
byyyyyyyyyyyyyyy
myyyyyseeeeeeeeeeeelf
Anymore
Alllllllllllll
byyyyyyyyyyyyyyyy
myyyyyyseeeeeeeeeeeeelf
Don't wanna live
Allllllllllll
byyyyyyyyyyyyyyy
myyyyyseeeeeeeeeeeelf
Anymore

United States the american morty Middletown, New Jersey  No.2652841 

Good pic

Palestine, State of the palestinian gamergater Khan Yunis, Gaza  No.2653174 +1 


Porkistan ANUSOID Newark, Ostrobothnia  No.2653336 

>>2653174
and that is why
all numales deserve it

Brazil admin Sao Paulo, Sao Paulo  No.2653448 +2 

>>2653336
including you?

Canada the canadian northern brother Quebec, Quebec  No.2653501 

up

Palestine, State of the palestinian hetnigger Khan Yunis, Gaza  No.2653942 

File: 1543410879054-0.png (121.06 KB, 593x298, ClipboardImage.png) ImgOps Google

File: 1543410879054-1.png (29.93 KB, 592x148, ClipboardImage.png) ImgOps Google

File: 1543410879054-2.png (59.2 KB, 589x327, ClipboardImage.png) ImgOps Google

File: 1543410879054-3.png (53.12 KB, 589x261, ClipboardImage.png) ImgOps Google

god i love it when all the memes align in a beautiful fashion

unfortunately i couldn't find any references to soylent (but i didn't really try)

United States morion Bellevue, Washington  No.2653945 

i’ll read this thread eventually

United States the american 尻神様 New Berlin, Wisconsin  No.2653947 

>>2653942
why programmer nerds gotta be like this

Palestine, State of the palestinian southern brother Khan Yunis, Gaza  No.2653950 +1 

>>2653947
what you're looking at is a specific subset of a programmer nerd

one that is known as a "functional programming" nerd

(anusoid happens to belong to the same group) (different variety though)

Canada autistic retard Calgary, Alberta  No.2653953 +1 

>>2653950
redpill me on the subsets

United States the american 尻神様 New Berlin, Wisconsin  No.2653956 +1 

>>2653950
todays active reddit user and eager young professional, elon musk acolyte

tomorrows busy father of one with a demanding middle management position at StartUp Inc, tesla model X owner

Palestine, State of the palestinian avian Khan Yunis, Gaza  No.2653960 

>>2653953
rustaceans, gophers, hasklars, jabbers, webshit, and the list goes on really,,,,

Porkistan ANUSOID Newark, Ostrobothnia  No.2654035 

>>2653950
I don't know if Lispers should even be called functional programmers. The syntax, libraries, and compilers facilitate the basics of FP by encouraging referential transparency, but the average Lisp/Scheme/Clojure puppy cares waay less about currying, types, monads, laziness etc.

If you asked a BBC lisp bull what the defining feature of xis language is, xe'd probably mention homoiconicity before anything that little white ML cuck balls care about.

United States the american kiribati Minneapolis, Minnesota  No.2654060 +4 

File: 1543417981560.mp4 (2.92 MB, 202x360, JAXON STRONG Halloween 201….mp4) ImgOps Google

>>2653950
fix spam alg

Palestine, State of the palestinian pilotboy Khan Yunis, Gaza  No.2654087 

>>2654035
99.99% of codecucks when they see "ML" they will assume it means "Machine Learning"

this tells you all you need to know about its legacy,,,

>>2654060
if you want me to touch PHP again, i expect to be paid hon

United States the american bearmode Minneapolis, Minnesota  No.2654088 

>>2654087
no i don't care i just submitted the wrong jaxon reading mp4

Palestine, State of the palestinian pilotboy Khan Yunis, Gaza  No.2654091 

File: 1543419791770.mp4 (285.36 KB, 492x360, oh ok.mp4) ImgOps Google

>>2654088
what do u even mean by "spam alg"

vichan had one by it's been completely disabled for like 1.5 years now except for accounts newer than 1 hour

Porkistan ANUSOID Newark, Ostrobothnia  No.2654095 

>>2654087
If your brain doesnt automatically expand ML to Marxism-Leninism

Its probably smooth

Sweden Proxy the swedish douglas  No.2654098 +1 

>>2654095
>>2654035
You are simply jealous anus rodi

t. Machine Learning Learner

Porkistan ANUSOID Newark, Ostrobothnia  No.2654102 

>>2654098

Du bist ….

Were talking about

https://en.m.wikipedia.org/wiki/ML_(language)

Grandaddy of languages like Hasklel, Ocaml, F# and the face that launched a thousand jerkoff sessions

Sweden Proxy the swedish hideloc american  No.2654103 


Sweden Proxy the swedish vagiworshipper  No.2654105 

>>2654102
I was interested in OCaml because Jane Street Quant Hedge Fund uses it.

Almost all Quant Hedge Funds run on their own Proprietary software. Nothing bought from outside.

Porkistan ANUSOID Newark, Ostrobothnia  No.2654124 

>>2654103
>blockchain
Dropped

>>2654105
Jane Street is the cited example of Ocaml's (and FP in general) success, just like Paul Graham making a webstore in the early 00s is still used to justify Lisp. I heard a lot of people are moving away from it though because of its anemic support for parallelism (also a problem in some Lisps). I think the future of high performance FP(ish) stuff will probably be in F# or Rust.

Brazil the brazilian witzig junge Sao Paulo, Sao Paulo  No.2654126 

>>2654105
Arent those funds having losses when something unexpected happen

Sweden Proxy the swedish kiribati  No.2654129 

>>2654124
>Dropped
Just like mama dropped you when you were born.

Retard. It's a Israeli genius who is building this.

Jane Street is rare. So if it become like a big Google type company in the Financial world it would be Black Rock then it would be copied by everyone.

>>2654126
Maybe. If you have shitty programmers and mathematical modeling people, you will make loses even when everyone is making profits.

Palestine, State of the palestinian minimum wage Khan Yunis, Gaza  No.2654152 

File: 1543422847595.png (1.79 MB, 2400x4800, www.faception.com_our-tech….png) ImgOps Google

>>2654129
>Retard. It's a Israeli genius who is building this.
israelis are retarded and incredibly racist

here's your average israeli machine learning startup

https://www.faception.com/

Sweden Proxy the swedish simian  No.2654155 

>>2654152
>>2654152
>israelis are retarded and incredibly racist
This startup is not faception. Nigga knows hwhat he's doing.

This nigga startup will predict me as Terrorist LOL.

Palestine, State of the palestinian futanari Khan Yunis, Gaza  No.2654162 

>>2654155
note how the terrorist and pedophile descriptions are literally the same word for word

this is probably a scam startup or a prank hmmm

Sweden Proxy the swedish täby  No.2654164 

>>2654162
>note how the terrorist and pedophile descriptions are literally the same word for word

Is there any difference between terrorist and pedo? I don't think so.

False Positives and False Negatives are very normal in ML.

If this nigga has connection of Bibi's network, this jigga gonn make ton of money with military contracts even if it's shit.

Netherlands the swedish tamil man  No.2654190 

>>2654091

>accounts newer than 1 hour


me almost every time i post

Palestine, State of the palestinian morty Khan Yunis, Gaza  No.2654202 

File: 1543426246214.mp4 (779.84 KB, 480x360, that's not my problem.mp4) ImgOps Google


Netherlands the swedish tamil man  No.2654215 

File: 1543426710127.jpg (Spoiler Image, 15.4 KB, 480x446, roach.jpg) ImgOps Exif Google


Brazil the brazilian cuck Sao Paulo, Sao Paulo  No.2654223 

>>2654129
Actually, machine learning in The West is Just a huge database being bruteforced in The most inefficient way. Basically those trading ml algos Just get what happened in The past do their shit. When stocks went down this and last month The robots lost a huge amount of money because we were in a Bull market for a long time and there were no data of consecutive losses in The robots database so bye bye investors money and hello margin calls of leveraged operations.

But I would like to see one of those quant funds screwing up with cyclical commodities. This is going to be beautiful, like the richest Trader in norway that lost all his money made nasdaq north lose a lot of money too.

Palestine, State of the palestinian mod Khan Yunis, Gaza  No.2654422 +1 

File: 1543437296914-0.png (17.12 KB, 781x113, ClipboardImage.png) ImgOps Google

File: 1543437296914-1.png (118.27 KB, 261x480, ClipboardImage.png) ImgOps Google

File: 1543437296914-2.png (58.37 KB, 663x570, ClipboardImage.png) ImgOps Google

File: 1543437296914-3.png (10.6 KB, 363x158, ClipboardImage.png) ImgOps Google

it keeps happening :DDD

Brazil admin Sao Paulo, Sao Paulo  No.2654425 


Norway the norwegian pilotboy Stavanger, Rogaland  No.2654428 +2 

>>2654422
ummmmm…… me…?

United States the american dogfucker Bellevue, Washington  No.2654432 

>>2654422
likelihood he wears programming socks?

Palestine, State of the palestinian rex's owner Khan Yunis, Gaza  No.2654445 

File: 1543438228951-0.png (34.75 KB, 1010x254, ClipboardImage.png) ImgOps Google

File: 1543438228951-1.png (37.05 KB, 927x342, ClipboardImage.png) ImgOps Google

File: 1543438228951-2.png (143.14 KB, 915x600, gZfBgPz.png) ImgOps Google


Palestine, State of the palestinian bing bing wahoo Khan Yunis, Gaza  No.2654446 +1 

File: 1543438334805-0.jpg (288.29 KB, 636x900, 54882553_p1_master1200.jpg) ImgOps Exif Google

File: 1543438334805-1.jpg (363.59 KB, 1000x667, 61799874_p3_master1200.jpg) ImgOps Exif Google

File: 1543438334805-2.jpg (280.47 KB, 667x1000, 61799874_p6_master1200.jpg) ImgOps Exif Google

File: 1543438334805-3.jpg (325.21 KB, 690x1000, 61799874_p8_master1200.jpg) ImgOps Exif Google

for wacky

Palestine, State of the palestinian chad Khan Yunis, Gaza  No.2654447 +1 

File: 1543438358528-0.png (269.24 KB, 636x900, CIIGn1Y.png) ImgOps Google

File: 1543438358528-1.png (587.26 KB, 1000x667, OROzjjJ.png) ImgOps Google

File: 1543438358528-2.png (375.13 KB, 667x1000, gSa2Ssz.png) ImgOps Google

File: 1543438358528-3.png (466.18 KB, 690x1000, 2jplgLC.png) ImgOps Google


Finland the finnish roy orbison Vaasa, Pohjanmaa  No.2654448 +2 

File: 1543438372295.png (567.37 KB, 900x720, ClipboardImage.png) ImgOps Google

>>2654445
Dice rollRolled 1d10. Result: 6.

Brazil admin Sao Paulo, Sao Paulo  No.2654454 


Finland killiam Mikkeli, Etela-Savo  No.2654459 +2 

>>2654447
>CIIGn1Y.png
when your hand meld into your cock-cock

United States the american unkler Middletown, New Jersey  No.2654470 +2 


Brazil admin Sao Paulo, Sao Paulo  No.2654474 

>>2654445
imaging using a lot of processing power for crap like that

Palestine, State of the palestinian unkel Khan Yunis, Gaza  No.2654478 

>>2654474
Literal Circlejerk: A Case Study on Machine Learning and Neural Networks

Brazil admin Sao Paulo, Sao Paulo  No.2654483 


Brazil admin Sao Paulo, Sao Paulo  No.2654484 

https://arxiv.org/

lol
imagine a doctoral thesis based on a software designed to pick clothes for vaginiggers

Canada the canadian anónimus Quebec, Quebec  No.2654771 

bros'e

where does one find info for the hottest nu-male framework

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2654779 

>>2654771
reddit
4chan

Palestine, State of the palestinian diaperfur fetishist Khan Yunis, Gaza  No.2654782 +1 

>>2654771
this is a front-end negative thread,,,

Palestine, State of the palestinian bsr Khan Yunis, Gaza  No.2655342 

like 85% of all asians (real asians, not asian americans etc.) (not including indians sorry chennai) on github have anime avatars

dare i say, BASED?

Palestine, State of the palestinian kcirclejerker Khan Yunis, Gaza  No.2655352 


Sweden Proxy the swedish northern brother  No.2655383 +5 

>>2655342
I never identified being Asian, I only identify myself as Dravidian. I cannot vouch for raped offsprings that is North India.

I have great respect for Singhala people too as they know their historical identity of coming from Bengal, even though they were against the aggressive Tamils in their country Sri Lanka.

Also Aryan Invasion theory is false and also true at the same time. False because the North Indians as well as South Indians came from elsewhere(Africa). But true because North Indians are raped offsprings of Muslim invasion(Mughals). It's like calling offsprings of Russian rapes in Germany as Germans.

United States the american hiv carrier Middletown, New Jersey  No.2655392 +1 


Sweden Proxy the swedish kekistani  No.2655396 +3 

>>2655392
Wacky I want you to go to that Radiology conference and troll the people there asking what is the difference between AI and Computer Aided Diagnosis?

Portugal Professor da pinga Lisbon, Lisboa  No.2655401 

File: 1543503071055.jpg (122.33 KB, 960x1280, IMG_20181129_145147_358.jpg) ImgOps Exif Google


Palestine, State of the palestinian faggot gay homo Khan Yunis, Gaza  No.2655417 


Palestine, State of the palestinian joonas Khan Yunis, Gaza  No.2656834 +2 

>Developers who identify as transgender men or women or of non-binary gender contribute to open source at higher rates (58% and 60%, respectively) than developers who identify as men or women overall (45% and 33%.)
BASED

United States the american beancuck San Jose, California  No.2656845 +1 

>>2656834
anusoid trappy socks HRT pegged by gf meat pie tits aussie hour github pushes fully dilated penis wound and loving it

Germany the german blöndal Darmstadt, Hessen  No.2656848 

File: 1543585501993.jpg (33.58 KB, 500x398, 1533746939362.jpg) ImgOps Exif Google


Palestine, State of the palestinian spook Khan Yunis, Gaza  No.2657612 +4 

https://www.theregister.co.uk/2018/11/30/blockchain_study_finds_0_per_cent_success_rate/
Blockchain study finds 0.00% success rate and vendors don't call back when asked for evidence

Palestine, State of the palestinian durstig junge Khan Yunis, Gaza  No.2657624 +1 

pinning threads is for fags

now this is a real advent calendar…
https://adventofcode.com/2018

Sweden Vastra Goeteborg, Vastra Gotalands lan  No.2657635 

>>2657624
fucking coding

and FUCK C++

United States Treat Boy Saint Louis, Missouri  No.2657637 

>>2656834
>rates (58% and 60%, respectively)
wait wut

Palestine, State of the palestinian gamergater Khan Yunis, Gaza  No.2657644 +1 

>>2657635
nobody likes C++ and that link has nothing to do with it you witless retard

>>2657637
transgenders of all kinds: 58%
non-binary (those who don't identify as male or female, which excludes based trannies): 60%
men: 45%
women (whores): 33%

Palestine, State of the palestinian women worshipper Khan Yunis, Gaza  No.2657836 

File: 1543630536703.png (93.99 KB, 334x483, ClipboardImage.png) ImgOps Google

speaking of non-binary open source contributors (BASED BASED BASED)

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2657839 

File: 1543630641616.mp4 (11.89 MB, 268x480, JAXON STRONG and the Tortu….mp4) ImgOps Google

>>2657836
>trying to kill c(++)

United States Arbeitopfer Watford City, North Dakota  No.2657840 +2 

>>2657836
>trying to kill C++
I sleep
>trying to kill C
REAL SHIT?

Palestine, State of the palestinian whiny emo faggot Khan Yunis, Gaza  No.2657845 

>>2657840
Rewrite Everything In Rust Or Die Trying

also cheyen b lyk: omg how else will i squeeze in -funroll-loops into my ricer linux CFLAGS

United States the american reddit suede Seattle, Washington  No.2657846 

damn, this has more first-year uni CS student tier thoughts than any KC thread even

United States the american cbronnenite New Berlin, Wisconsin  No.2657848 

>>2657846
i know css

United States Arbeitopfer Watford City, North Dakota  No.2657850 

>>2657845
Unrolling loops is so last decade brother
Now it's all about that -flto=8 -floop-block -floop-interchange -floop-strip-mine -ftree-loop-distribution

Palestine, State of the palestinian adnan Khan Yunis, Gaza  No.2657853 

>>2657850
stop putting in (pointless) portage gcc flags they do more harm than good smh,,,

United States Arbeitopfer Watford City, North Dakota  No.2657859 +6 

File: 1543631508933.jpg (57.37 KB, 500x500, 2nvv70.jpg) ImgOps Exif Google


Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2657929 


Palestine, State of the palestinian paintknight Khan Yunis, Gaza  No.2660167 


United States I Wish I Was In Dixie Raleigh, North Carolina  No.2661089 

>>2639701
iirc the reason we had to play on the macabre russian server was because you guys had the real game but i was too cheap to buy it so i got a cracked version that couldn't join steam servers and we kept getting kicked from the ameri one or smth

United States the american tranny Southaven, Mississippi  No.2661092 

>>2661089
correct
not being able to understand the other players made it more epic though tbh

Netherlands the swedish tamil man  No.2661095 

bronnen needs to adopt the Contributor Covenant ASAP

Canada the canadian pepe garrison Quebec, Quebec  No.2661103 

here to represent trap programmers

Palestine, State of the palestinian chadcel Khan Yunis, Gaza  No.2661114 +1 

>>2661103
pix????

Porkistan ANUSOID Newark, Ostrobothnia  No.2662552 +3 

Lets keep this bunped until Australia jungen

Palestine, State of the palestinian beefer Khan Yunis, Gaza  No.2663040 +1 


Germany the german piteå Munich, Bayern  No.2663056 +2 

File: 1543934217850.png (271.27 KB, 480x480, fade.png) ImgOps Google

all this time and i still dont exactly know how cmake works

its a lot like me playing fighting games on console, me just semi-randomly smash keys the way i observe to work

Palestine, State of the palestinian meat toilet Khan Yunis, Gaza  No.2663065 +1 

>>2663056
CLion forced me to learn how CMake works because it wouldn't let me do it the old fashioned way

yet it still has way too many unnecessary complexities (e.g pkgconf plugin vs find_package module) for things that are trivially handled in modern programming languages' toolchains (that really spoil you until you need C/C++ FFI interop)

Porkistan ANUSOID Newark, Ostrobothnia  No.2663312 

If you don't write portable makefiles

Your my enemy

Porkistan ANUSOID Newark, Ostrobothnia  No.2664931 


Porkistan ANUSOID Newark, Ostrobothnia  No.2666296 


Netherlands the swedish tamil man  No.2666979 

File: 1544146379107.png (36.67 KB, 997x315, go syntax.png) ImgOps Google


Palestine, State of the palestinian täby Khan Yunis, Gaza  No.2667260 

>>2666979
lol no generics

lol no fearless concurrency

lol no zero cost abstractions

Porkistan ANUSOID Newark, Ostrobothnia  No.2668167 


Netherlands the swedish tamil man  No.2668900 

File: 1544297375776-0.png (815.09 KB, 665x669, 1.png) ImgOps Google

File: 1544297375776-1.png (880.3 KB, 669x661, 2.png) ImgOps Google


Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2668918 

>>2668900
delete

reeeeeeeeeeeeeeeeeeeeeeeeeeeee

Netherlands the swedish tamil man  No.2668925 +1 

>>2668918

what's wrong sweetie ?

can't handle an AI researcher AND an astrophysicist ?

Palestine, State of the palestinian lumpenprole Khan Yunis, Gaza  No.2668930 +3 

>>2668900
AI Program Director 🤖👩🏼‍💻Astrophysicist 💫🔭 Science Communicator ⚛️ 🚀 Machine Learning Engineer 💻🐍 Chocolate connoisseur 🍫🍩☕️

Turkey Süleyman Arabacı Kirsehir, Kirsehir  No.2668933 

>>2668900
how to pick up such a womeme? what does she wants

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2668934 

>>2668925
AI is shit

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2668935 


Turkey Süleyman Arabacı Kirsehir, Kirsehir  No.2668939 +2 

>>2668935
eeeeeeeeee
that's exactly what i have
KARA BOĞA

Netherlands the swedish tamil man  No.2668940 

>>2668933

attention

Palestine, State of the palestinian gayboy Khan Yunis, Gaza  No.2668941 +3 

big-brained introverted shy cats & DnD loving girl gamer graduate student

but also a literal whore

we live in a society

bottom text

United States the american individual 1 New Berlin, Wisconsin  No.2668949 +3 

File: 1544300024887.jpg (46.08 KB, 528x960, bae lookin at u.jpg) ImgOps Exif Google

i met a vagina having engineer programmer lady yesterday

she was going thru test results on a spect scanner

i felt very small brained in that building

United States the american lolcow Minneapolis, Minnesota  No.2669236 

if roy is working minimum wage then must have not been at stables recently and must be making pizza
if roy has been @stables recently then he must have a gay voice and have taken a gun selfie recently
if roy has a gay voice then he must not be active in judaism and must not be making pizza
if roy is jewish then he must be working minimum wage and have taken a gun selfie recently

if we know whether roy is making pizza and whether roy has taken a gun selfie recently, determine whether roy is jewish, has a gay voice, has been @stables recently and working minimum wage

Porkistan ANUSOID Newark, Ostrobothnia  No.2669286 +5 

If this thread becomes a vehicle for misogyny then I will delete it

United States Osama's Fifth Wife Center Moriches, New York  No.2669288 

>>2669286
Don't worry I was pondering on deleting it either way

United States the american african american Minneapolis, Minnesota  No.2669788 


Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2672117 


Turkey Many Rivers to Cross Eskisehir, Eskisehir  No.2672378 +3 

This thread must survive for 2 years

Lithuania the lithuanian futanari Kaunas, Kauno apskritis  No.2672379 +2 

>>2669286
cringe

United States gopnik!Wo0bn/JfrQ Council Bluffs, Iowa  No.2672382 +1 

>>2669788
he's mad at a woman for answering a question

United States Osama's Fifth Wife Center Moriches, New York  No.2673248 +2 

>>2672382
Misogyny is a mental illness

Canada the canadian csgo Quebec, Quebec  No.2673250 +1 

>>2669788
answering astrophysics and ai questions on quora is work

Finland the finnish house burner Vaasa, Pohjanmaa  No.2674406 


Dice rollRolled 1d10. Result: 4.

Palestine, State of the palestinian ntgger Khan Yunis, Gaza  No.2674700 +1 

puppy spent all day in AWS HQ @ Tel Aviv

free food and coffee but puppy wants to go home but it's till 20:00 aaaa

Palestine, State of the palestinian horse rapist Khan Yunis, Gaza  No.2674708 +2 

>>2674702
based bezos gave me an offer i couldn't refuse

Sweden Proxy the swedish cam fapper  No.2674753 +2 

>>2674708
Congrats bro, now it's time to use your recommendation and get me a job at AWS

United States the american normalfag Bellevue, Washington  No.2675071 

anusoid
fm
kys

Palestine, State of the palestinian house burner Khan Yunis, Gaza  No.2675077 +2 

>>2675071
shoo shoo walmart greeters and other lumpens aren't welcome ITT

United States the american junge Bellevue, Washington  No.2675083 

>>2675077
ok altshite ukrainian

Palestine, State of the palestinian reptillian Khan Yunis, Gaza  No.2675094 +1 

>>2675081
hmmm

>>2675083
i said you're not welcome ITT heritage larping ameri paska loser tryhard lumpen zoomer

adults only

United States the american gwen Bellevue, Washington  No.2675109 

>>2675094
ok dude
tippidy type im programming hella hype my nigga computer

United States Treat Boy Osage Beach, Missouri  No.2675132 

File: 1544647782918.webm (3.31 MB, 1280x720, 1452669503718.webm) ImgOps Google


United States the american gaymer Bellevue, Washington  No.2675135 

>>2675132
damn LOVE OR LUST damn

Palestine, State of the palestinian lola Khan Yunis, Gaza  No.2676415 

eeeeeee just got a pull request

apparently the lib i wrote 2 months ago is being used in production by some ameri software company and they want to contribute

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2677106 

>>2676415
Time to get that cozy job at a scam start up where you work for free and in The end they Just give you a used iPhone 8.

United States Treat Boy Saint Louis, Missouri  No.2677112 +1 

>>2676415
xtian gets plenty of pull requests he just pretends he cant hear her

Palestine, State of the palestinian faggot gay homo Khan Yunis, Gaza  No.2677218 +1 

anus rodi sings this every day

Palestine, State of the palestinian staffas Khan Yunis, Gaza  No.2679455 +2 

File: 1544900820269.png (204.29 KB, 1073x822, ClipboardImage.png) ImgOps Google


United States the american avian Elkridge, Maryland  No.2679460 

>>2679455
me basic bitch lyfe

Palestine, State of the palestinian hetnigger Khan Yunis, Gaza  No.2681188 

puppy bought a bunch of development boards for some embedded devkeving

wasted almost 200$ lool

stay tuned

Palestine, State of the palestinian oblivious hussy Khan Yunis, Gaza  No.2683514 +1 

File: 1545171114173-0.png (122.96 KB, 338x510, ClipboardImage.png) ImgOps Google

File: 1545171114173-1.png (290.29 KB, 605x747, ClipboardImage.png) ImgOps Google


Greece the greek sonichu Athens, Attiki  No.2683520 

>>2683514
Is she redpilled as a programmer

Palestine, State of the palestinian sissy Khan Yunis, Gaza  No.2683535 

>>2683520
i tried finding xir github etc. but i only found an instagram and a youtube ASMR channel

also xes a front end dev so that should answer the question definitively

Greece the greek unkel Athens, Attiki  No.2683541 

>>2683535 on a scale of 1 being a homeless man typing on a calculator and 10 idk bill gates how redpilled

Palestine, State of the palestinian joonas Khan Yunis, Gaza  No.2683552 +4 

File: 1545172858665.png (135.68 KB, 750x570, ClipboardImage.png) ImgOps Google


Greece the greek fat fuck Athens, Attiki  No.2683564 


Turkey the turkish witzig junge Istanbul, Istanbul  No.2683574 +8 

File: 1545174078619.png (629.6 KB, 695x848, ClipboardImage.png) ImgOps Google

>>2683514
based whore

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2683576 +4 

File: 1545174151268.png (153.12 KB, 370x394, Screenshot_20181208_192348.png) ImgOps Google


Netherlands Advanced  No.2683727 +2 

File: 1545183282975.mp4 (12.96 MB, 404x720, The second hand embarrassm….mp4) ImgOps Google

Note to staff: Don't forget the mandatory team-building event this friday at 19:00. Let's get this party rocking!

United States Osama's Fifth Wife Center Moriches, New York  No.2683734 +4 

>>2683727
Imagine all the dog abuse hiding behind that plastic enthusiasm

Palestine, State of the palestinian hetloser Khan Yunis, Gaza  No.2683743 +5 

>>2683727
>PricewaterhouseCoopers (doing business as PwC) is a multinational professional services network headquartered in London, United Kingdom. PwC ranks as the second largest professional services firm in the world behind Deloitte,[5] and is one of the Big Four auditors, along with Deloitte, EY and KPMG.[6] Vault Accounting 50 has ranked PwC as the most prestigious accounting firm in the world for seven consecutive years, as well as the top firm to work for in North America for three consecutive years.[7]

>There is no definitive list of occupations in professional services, but commonly held examples include the following:


>Accountant

>Actuary
>Evaluator
>Financial planner
>Investment manager
>IT consultant
>Lawyer
>Management consultant
>Training and development

welcome to your new job, daunas!

Palestine, State of the palestinian futacock Khan Yunis, Gaza  No.2684438 +2 

File: 1545230813149-0.png (466.97 KB, 627x1058, ClipboardImage.png) ImgOps Google

File: 1545230813149-1.png (207.11 KB, 621x1045, ClipboardImage.png) ImgOps Google


Greece the greek autist Athens, Attiki  No.2684442 

>>2684438
#depressedcodethots
Did you see that one hashtag tho lol it's epic and speaks volumes about society

Anyway point is
In every era there are self taught prodigys who are not the rule but bright expressions
Do these hackerthots actually have any marketable programming assets or are they playing the black female with attitude in hostile business environment card

Sweden Proxy the swedish gamergater  No.2684448 

>>2684438
My gf :)

Sweden Proxy the swedish bateman  No.2684451 

>>2681188
Good.

What are the names of those?

Sweden Proxy the swedish joonas  No.2684454 

>>2683535
Me upload someone else's on Github as mine. LOL

Palestine, State of the palestinian bougie Khan Yunis, Gaza  No.2684545 

>>2684454
episch

>>2684451
i don't want to ruin the surprise :)

one of them is microcontroller based and the other has a full fledged quad core cpu

United States Red Dead Redaction Port Angeles, Washington  No.2684566 

>>2683514
living my best life

Palestine, State of the palestinian behindert Khan Yunis, Gaza  No.2684914 +1 

File: 1545258717017.jpg (101.03 KB, 960x960, jdK41d68uK37SD-hbz8DSXzYCx….jpg) ImgOps Exif Google

:DDDDDDD

Germany the german junge Darmstadt, Hessen  No.2684953 

nice pics

Netherlands Advanced  No.2684961 +2 

File: 1545261010541.jpg (764.26 KB, 3120x4160, luka arm.jpg) ImgOps Exif Google

>>2684914

same

person ?_?

Palestine, State of the palestinian futanari Khan Yunis, Gaza  No.2684964 

File: 1545261144273.png (8.03 KB, 220x59, ClipboardImage.png) ImgOps Google


Sweden Proxy the swedish lucas bailey  No.2685784 +2 

uppppppp

Sweden Proxy the swedish diaperfur fetishist  No.2685789 +2 

>>2683727
These are the kind of women who sleep with different races before marrying some white cuck.

United States the american bulge noticer Middletown, New Jersey  No.2687564 +1 

"I know tech better than anyone"

-the president

Palestine, State of the palestinian bronze gentleman Khan Yunis, Gaza  No.2688602 

File: 1545487719430.png (16.57 KB, 378x243, ClipboardImage.png) ImgOps Google

based!

United States the american individual 1 New Berlin, Wisconsin  No.2688866 +3 

File: 1545500369006.jpg (360.85 KB, 640x1280, fGsKZIc.jpg) ImgOps Exif Google


United Kingdom xXx_Knee_Grow_Slayer_xXx Wyken, England  No.2688868 +3 

File: 1545500438102.jpg (375.4 KB, 1253x1600, 210.JPG) ImgOps Exif Google


United States jesus was a ancap Bellevue, Washington  No.2688879 +2 

>>2688602
i'll have it to you soon sir

Argentina the argentine thirster San Carlos de Bariloche, Rio Negro  No.2688887 

>>2688866
ill never get the appealling of whiteboards

why not just write on a paper

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2688899 +1 

>>2688887
why not just drawing on a tablet, lol

Palestine, State of the palestinian durstig junge Khan Yunis, Gaza  No.2688902 +1 

>>2688879
*docks points for tardiness and gets you banned from the program for having a rating lower than 4.9/5*

>>2688887
>>2688899
why not just scribble on cavern walls with jagged rocks 'n' shit

United States jesus was a ancap Bellevue, Washington  No.2688909 +1 

>>2688902
no, mr bezos PLEASE
not the reeducation 'training'!

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2688911 +1 

>>2688902
>why not just scribble on cavern walls with jagged rocks 'n' shit

and posting it behind a table with a bottle and cup of wine and a stinky cat to show how a smart cave gurrl you are

Sweden Proxy Der Analytiker: Data entry clerk  No.2688944 +1 

food thread no pics

Palestine, State of the palestinian tranny lover Khan Yunis, Gaza  No.2689275 


United States the american african american Madison, Wisconsin  No.2689434 

>>2688887
paper is painful when you don't have enough space

Palestine, State of the palestinian witzig junge Khan Yunis, Gaza  No.2691773 

where rodi @

did you go boom and didn't get on the news

Germany escapism pro!snw79wAK4o Osterholz-Scharmbeck, Niedersachsen  No.2691926 +5 

File: 1545658722615.jpg (34.37 KB, 572x714, 1541938212292.jpg) ImgOps Exif Google


Dice rollRolled fortune rate yolo. Result: False.

Palestine, State of the palestinian tribute Khan Yunis, Gaza  No.2694381 +3 

rodi dead

Sweden Vastra Goeteborg, Vastra Gotalands lan  No.2694383 +2 

>>2694381
more like rodi too busy being an NT to post

United States the american individual 1 New Berlin, Wisconsin  No.2694392 

>>2694383
yeah he just moved across the globe to be with his fiancee give the man a moment to adjust!

Netherlands Advanced  No.2694404 +2 

>>2674708
>>2681188

ah, a future Amazon WorkerCage™ firmware developer i see !

Palestine, State of the palestinian 8channer Khan Yunis, Gaza  No.2694407 


Netherlands Advanced  No.2694415 +4 

>>2694407

alex, meet the maverick programmer behind your daily bathroom break starting next month

United States Osama's Fifth Wife Center Moriches, New York  No.2694544 +1 

anusoid has not posted in a long
long
time

Finland the finnish virgin Lappeenranta, Etela-Karjala  No.2694884 +1 

where anusroid
Dice rollRolled 1d10. Result: 7.

Palestine, State of the palestinian adnan Khan Yunis, Gaza  No.2697411 

did anyone check the news for failed suicide bombings in the northeast ?_?

Denmark the danish northern brother Lynge, Hovedstaden  No.2697419 +1 

i just read the whole thread and i dont know anything about coding

Finland the finnish cbronnenite Vampula, Satakunta  No.2697601 +5 

Computer internet
Dice rollRolled 1d10. Result: 6.

Australia the australian paintknight Gold Coast, Queensland  No.2697606 +2 

File: 1546013998135.png (117.87 KB, 694x732, 1502185162216.png) ImgOps Google


Palestine, State of the palestinian steve rambo Khan Yunis, Gaza  No.2697620 +2 

File: 1546015439722.jpg (15.04 KB, 640x640, J6iJdpr_d.jpg) ImgOps Exif Google

>>2697608
how many guidobux

United States Treat Boy Osage Beach, Missouri  No.2697636 +2 

File: 1546016330234.png (333.83 KB, 480x356, auo.png) ImgOps Google


Palestine, State of the palestinian chino Khan Yunis, Gaza  No.2698384 

File: 1546045444043-0.png (117.11 KB, 298x482, ClipboardImage.png) ImgOps Google

File: 1546045444043-1.png (71.35 KB, 607x383, ClipboardImage.png) ImgOps Google


Sweden Vastra Goeteborg, Vastra Gotalands lan  No.2698390 

>>2698384
let me think

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2698394 

>>2698384
cant wait for the next nasdaq crash and all start ups getting btfod after uber ipo

Canada the canadian hairline Quebec, Quebec  No.2698414 

>>2698384
I can't understand how retarded this is

Canada the canadian kid sucker Quebec, Quebec  No.2698415 

>>2698384
lol @ the thread full of thirsty men

Australia the australian gymcel Gold Coast, Queensland  No.2698475 +2 

>>2698384
we need more female ambassadors like her

Palestine, State of the palestinian nippr daemon Khan Yunis, Gaza  No.2698495 

ok to keep this thread from dying or devolving to just discussions about how wymo are stupid etc.

i'm gonna post my Advent of Code 2018 solutions here as I solve them

started today with 1 & 2:

use std::collections::HashSet;
use std::error::Error;
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::path::Path;

fn parse_input(path: &Path) -> Result<Vec<i32>, Box<dyn Error>> {
let f = File::open(path)?;

BufReader::new(f)
.lines()
.map(|line| {
line.map_err(|e| e.into())
.and_then(|s| s.parse::<i32>().map_err(|e| e.into()))
})
.collect()
}

fn part_one(numbers: &[i32]) -> i32 {
numbers.iter().sum()
}

fn part_two(numbers: &[i32]) -> i32 {
numbers
.iter()
.cycle()
.scan((0, HashSet::new()), |(sum, set), &num| {
if !set.insert(*sum) {
Some(Some(*sum))
} else {
*sum += num;

Some(None)
}
})
.find_map(|a| a)
.unwrap()
}

fn main() -> Result<(), Box<dyn Error>> {
let path = Path::new("inputs/input-01-01.txt");

let values = parse_input(path)?;

println!("Part 1: {}", part_one(&values));

println!("Part 2: {}", part_two(&values));

Ok(())
}


use std::collections::HashSet;
use std::fs::File;
use std::io::{Error, Read};
use std::path::Path;

fn parse_input(path: &Path) -> Result<String, Error> {
let mut s = String::new();

File::open(path)?.read_to_string(&mut s)?;

Ok(s)
}

fn part_one(s: &str) -> i32 {
let (mut two, mut three) = (0, 0);

let mut frequency: [u8; 256];

for s in s.lines() {
frequency = [0u8; 256];

for c in s.bytes().map(|c| c as usize) {
frequency[c] = frequency[c].saturating_add(1);
}

if frequency.iter().any(|&n| n == 2) {
two += 1;
}

if frequency.iter().any(|&n| n == 3) {
three += 1;
}
}

two * three
}

fn part_two(s: &str) -> Option<String> {
let len = s.lines().next()?.len();

for i in 0..len {
let mut h = HashSet::new();

for s in s.lines() {
let key = String::with_capacity(len - 1) + &s[..i] + &s[i + 1..];

if let Some(key) = h.replace(key) {
return Some(key);
}
}
}

None
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-02-01.txt");

let s = parse_input(path)?;

println!("Part 1: {}", part_one(&s));
println!("Part 2: {:?}", part_two(&s));

Ok(())
}


good night

Netherlands Advanced  No.2698545 

File: 1546059179480.png (1.03 MB, 1920x1080, 1356060476850.png) ImgOps Google

which one, /b/ ?

Australia the australian summerfag Gold Coast, Queensland  No.2698567 

>>2698495
fucking computer nerd lol nice laptop does that get you pussy dweeb

Turkey the turkish kiribati Istanbul, Istanbul  No.2698618 +5 

wymo are stupid

United States Arbeitopfer Watford City, North Dakota  No.2698621 +3 

>>2698545
Lucas Bailey headmates list

United States Arbeitopfer Watford City, North Dakota  No.2698634 

>>2698545
also
why isn't Java/Scala not Kirinorway fatpro lardasses?

Palestine, State of the palestinian hideloc american Khan Yunis, Gaza  No.2698935 

File: 1546099858602.png (29.09 KB, 582x128, ClipboardImage.png) ImgOps Google


United States Osama's Fifth Wife Center Moriches, New York  No.2699578 

File: 1546127342650.mp3 (10.82 MB, 255x255, Tears.mp3) ImgOps Google

anusoid
Return

United States the american bluepilled cuck San Jose, California  No.2699674 +1 

I was paid by Anusoid to make posts about him on bronnen

Palestine, State of the palestinian steve rambo Khan Yunis, Gaza  No.2699679 

File: 1546133137748.txt (30.08 KB, input-03-01.txt)

day 3:

use std::error::Error;
use std::fmt::{self, Display, Formatter};
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::path::Path;

use regex::Regex;

const BOARD_SIZE: usize = 1 << 10;

struct Offset(usize, usize);

struct Size(usize, usize);

struct Rect {
id: u32,
offset: Offset,
size: Size,
}

#[derive(Debug)]
struct PatternError;

impl Display for PatternError {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
write!(f, "Invalid pattern.")
}
}

impl Error for PatternError {}

fn parse_input(path: &Path) -> Result<Vec<Rect>, Box<dyn Error>> {
let re = Regex::new(r"#(\d{1,4}) @ (\d{1,3}),(\d{1,3}): (\d{1,3})x(\d{1,3})").unwrap();

let f = File::open(path)?;

BufReader::new(f)
.lines()
.map(|line| {
line.map_err(|e| e.into()).and_then(|s| {
re.captures(&s)
.ok_or_else(|| PatternError)
.and_then(
|c| match (c.get(1), c.get(2), c.get(3), c.get(4), c.get(5)) {
(Some(id), Some(off_x), Some(off_y), Some(size_x), Some(size_y)) => {
Ok(Rect {
id: id.as_str().parse().unwrap(),
offset: Offset(
off_x.as_str().parse().unwrap(),
off_y.as_str().parse().unwrap(),
),
size: Size(
size_x.as_str().parse().unwrap(),
size_y.as_str().parse().unwrap(),
),
})
}
_ => Err(PatternError),
},
)
.map_err(|e| e.into())
})
})
.collect()
}

fn part_one(rects: &[Rect]) -> ([[u8; BOARD_SIZE]; BOARD_SIZE], u32) {
let mut board = [[0u8; BOARD_SIZE]; BOARD_SIZE];

let collisions: usize = rects
.iter()
.map(|rect| {
board
.iter_mut()
.skip(rect.offset.1)
.take(rect.size.1)
.flat_map(|row| {
row.iter_mut()
.skip(rect.offset.0)
.take(rect.size.0)
.map(|cell| {
*cell = cell.saturating_add(1);
*cell
})
.filter(|&cell| cell == 2)
})
.count()
})
.sum();

(board, collisions as u32)
}

fn part_two(rects: &[Rect], board: [[u8; BOARD_SIZE]; BOARD_SIZE]) -> Option<u32> {
rects
.iter()
.find(|&rect| {
board
.iter()
.skip(rect.offset.1)
.take(rect.size.1)
.map(move |&row| {
row.iter()
.skip(rect.offset.0)
.take(rect.size.0)
.all(|&cell| cell == 1)
})
.all(|on| on)
})
.map(|rect| rect.id)
}

fn main() -> Result<(), Box<dyn Error>> {
let path = Path::new("inputs/input-03-01.txt");

let rects = parse_input(path)?;

let (board, collisions) = part_one(&rects);

println!("Part 1: {}", collisions);
println!("Part 2: {:?}", part_two(&rects, board));

Ok(())
}

Palestine, State of the palestinian tree hugger Khan Yunis, Gaza  No.2701233 

File: 1546240297312.txt (33.09 KB, input-04-01.txt)

day 4:

use std::collections::{BTreeMap, HashMap};
use std::error::Error;
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::path::Path;

use regex::Regex;

struct Distribution {
histogram: [u8; 1 << 6],
total: usize,
}

enum Entry {
GuardId(usize),
FallAsleep(usize),
WakeUp(usize),
}

fn parse_input(path: &Path) -> Result<HashMap<usize, Distribution>, Box<dyn Error>> {
let f = File::open(path)?;

let regex = Regex::new(
r"(?x)
\[
\d{4}-\d{2}-\d{2}
\s\d{2}:(?P<minute>\d{2})
]\s
(?P<entry>wakes\sup
|falls\sasleep
|Guard\s\#(?P<guard>\d+))",
)
.unwrap();

let ordered: BTreeMap<String, Entry> = BufReader::new(f)
.lines()
.map(|line| {
line.map_err(|e| e.into()).and_then(|s| {
match regex.captures(&s) {
None => Err(Box::<Error>::from("Invalid pattern.")),
Some(cap) => match &cap["entry"] {
"falls asleep" => Ok(Entry::FallAsleep(cap["minute"].parse().unwrap())),
"wakes up" => Ok(Entry::WakeUp(cap["minute"].parse().unwrap())),
_ => Ok(Entry::GuardId(cap["guard"].parse().unwrap())),
},
}
.map(|entry| (s, entry))
})
})
.collect::<Result<_, _>>()?;

let mut h = HashMap::new();

ordered
.into_iter()
.fold((0, 0), |(id, start), (_, entry)| match entry {
Entry::GuardId(id) => (id, 0),
Entry::FallAsleep(start) => (id, start),
Entry::WakeUp(end) => {
let dist = h.entry(id).or_insert(Distribution {
histogram: [0u8; 1 << 6],
total: 0,
});

dist.total += end - start;

for x in &mut dist.histogram[start..end] {
*x = x.saturating_add(1);
}

(id, 0)
}
});

Ok(h)
}

fn part_one(h: &HashMap<usize, Distribution>) -> Option<usize> {
h.iter()
.max_by_key(|&(_, &Distribution { total, .. })| total)
.map(|(&id, &Distribution { histogram, .. })| {
histogram
.iter()
.enumerate()
.max_by_key(|&(_, &val)| val)
.map(|(a, _)| a)
.unwrap()
* id
})
}

fn part_two(h: &HashMap<usize, Distribution>) -> Option<usize> {
h.iter()
.map(|(&id, &Distribution { histogram, .. })| {
let (minute, &frequency) = histogram
.iter()
.enumerate()
.max_by_key(|&(_, &val)| val)
.unwrap();

(id, minute, frequency)
})
.max_by_key(|&(_, _, frequency)| frequency)
.map(|(id, minute, _)| id * minute)
}

fn main() -> Result<(), Box<dyn Error>> {
let path = Path::new("inputs/input-04-01.txt");

let h = parse_input(path)?;

println!("Part 1: {:?}", part_one(&h));
println!("Part 2: {:?}", part_two(&h));

Ok(())
}

Finland the finnish moronic twat Vampula, Satakunta  No.2701234 +2 

Anusoid would have loved these updates
Dice rollRolled 1d10. Result: 2.

United States Osama's Fifth Wife Center Moriches, New York  No.2701235 +2 

>>2699674
>>2701234
We were just another ho for him

Palestine, State of the palestinian lolcow Khan Yunis, Gaza  No.2701236 +3 

>>2701234
fuck anusoid

every minute he's ignoring his own thread on bronnen he's giving his gf attenshun we deserve

Palestine, State of the palestinian incel Khan Yunis, Gaza  No.2701342 +4 

File: 1546258171290.jpg (2.81 MB, 4032x3024, 20181231_140806.jpg) ImgOps Exif Google

based! just in time for NYE

Sweden Proxy the swedish autist  No.2701351 +4 

>>2701342
Time to make Robot gf

Germany escapism pro!snw79wAK4o Bremen, Bremen  No.2701527 +1 

File: 1546268301304.jpg (309.22 KB, 1200x1500, 1539887929642.jpg) ImgOps Exif Google

pro
Dice rollRolled fortune rate yolo. Result: False.

United States Osama's Fifth Wife Center Moriches, New York  No.2701645 +1 

File: 1546271005647.png (657.02 KB, 1428x1080, 1544145046327.png) ImgOps Google

anusoid is now living
in another part of the world
in a beautiful house
and a beautiful wife

United Kingdom the british janitor Upton upon Severn, England  No.2701649 

>>2701342
do you have epic heatsink block too

Israel the israeli gayboy Petah Tikva, HaMerkaz  No.2701667 +2 

File: 1546271697033.jpg (2.95 MB, 4032x3024, 20181231_174748.jpg) ImgOps Exif Google

>>2701649
yea but imma assemble it later

Finland Proxy the finnish orbimod Helsinki, Uusimaa  No.2701675 

>>2701645
some folks just are not made to be winners…
Dice rollRolled 1d10. Result: 4.

Finland the finnish bhenchod Vampula, Satakunta  No.2703254 

This survived
Dice rollRolled 1d10. Result: 1.

Germany Proxy the german wizard Frankfurt am Main, Hessen  No.2703327 

>>2701667
i need to repost this elsewhere later

Palestine, State of the palestinian alex jones Khan Yunis, Gaza  No.2704188 

File: 1546388727859.txt (48.83 KB, input-05-01.txt)

day 5:

use std::fs::File;
use std::io::{prelude::*, BufReader, Error};

use std::path::Path;

fn parse_input(path: &Path) -> Result<Vec<u8>, Error> {
let f = File::open(path)?;

BufReader::new(f)
.bytes()
.filter(|result| match result {
Ok(x) if !x.is_ascii_alphabetic() => false,
_ => true,
})
.collect()
}

fn opposite_case(a: u8, b: u8) -> bool {
if a > b {
a - b == 0x20
} else {
b - a == 0x20
}
}

fn react(poly: &[u8], buffer: &mut Vec<u8>, skip: u8) {
for &unit in poly {
if skip == unit || skip == unit + 0x20 {
continue;
}

match buffer.last() {
Some(&last) if opposite_case(unit, last) => {
buffer.pop();
}
_ => buffer.push(unit),
};
}
}

fn part_one(poly: &[u8]) -> usize {
let buffer = &mut vec![];

react(poly, buffer, 0);

buffer.len()
}

fn part_two(poly: &[u8]) -> usize {
let buffer = &mut vec![];

(b'a'..=b'z')
.map(|skip| {
buffer.truncate(0);
react(poly, buffer, skip);

buffer.len()
})
.min()
.unwrap()
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-05-01.txt");

let poly = parse_input(path)?;

println!("Part 1: {:?}", part_one(&poly));
println!("Part 2: {:?}", part_two(&poly));

Ok(())
}

Palestine, State of the palestinian burger flipper Khan Yunis, Gaza  No.2705861 

File: 1546479083105.txt (431 B, input-06-01.txt)

day 6:

use std::fmt;
use std::fs::File;
use std::io::{prelude::*, BufReader, Error as IoError};
use std::iter;
use std::path::Path;

const MAX_TOTAL: u32 = 10000;

#[derive(Debug)]
enum Error {
Io(IoError),
Invalid,
}

impl From<IoError> for Error {
fn from(e: IoError) -> Self {
Error::Io(e)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::Invalid => write!(f, "invalid input"),
}
}
}

fn parse_input(path: &Path) -> Result<Vec<(u32, u32)>, Error> {
BufReader::new(File::open(path)?)
.lines()
.map(|line| {
line.map_err(|e| e.into()).and_then(|s| {
let mut iter = s.split(", ").map(|s| s.parse());

match (iter.next(), iter.next()) {
(Some(Ok(x)), Some(Ok(y))) => Ok((x, y)),
_ => Err(Error::Invalid),
}
})
})
.collect()
}

fn bounds(coordinates: &[(u32, u32)]) -> (u32, u32, u32, u32) {
coordinates
.iter()
.fold((!0, !0, 0, 0), |(x_min, y_min, x_max, y_max), &(x, y)| {
(
if x < x_min { x } else { x_min },
if y < y_min { y } else { y_min },
if x > x_max { x } else { x_max },
if y > y_max { y } else { y_max },
)
})
}

fn abs(a: u32, b: u32) -> u32 {
if a > b {
a - b
} else {
b - a
}
}

fn distance(a: (u32, u32), b: (u32, u32)) -> u32 {
abs(a.0, b.0) + abs(a.1, b.1)
}

fn fold_min(accumulator: (Option<usize>, u32), input: (usize, u32)) -> (Option<usize>, u32) {
let (id, min) = accumulator;
let (i, dist) = input;

if dist < min {
(Some(i), dist)
} else if dist == min {
(None, min)
} else {
(id, min)
}
}

fn find_min(coordinates: &[(u32, u32)], position: (u32, u32)) -> Option<usize> {
let (id, _) = coordinates
.iter()
.map(|&z| distance(position, z))
.enumerate()
.fold((None, !0), fold_min);

id
}

fn part_one(coordinates: &[(u32, u32)]) -> u32 {
let (x_min, y_min, x_max, y_max) = bounds(coordinates);

let mut counter = vec![0u32; coordinates.len()];

(y_min + 1..y_max)
.flat_map(|y| (x_min + 1..x_max).filter_map(move |x| find_min(coordinates, (x, y))))
.for_each(|id| counter[id] += 1);

(x_min..x_max)
.zip(iter::repeat(y_min))
.chain(iter::repeat(x_max).zip(y_min..=y_max))
.chain(
(x_min..x_max)
.zip(iter::repeat(y_max))
.chain(iter::repeat(x_min).zip(y_min + 1..y_max)),
)
.filter_map(|position| find_min(coordinates, position))
.for_each(|id| counter[id] = 0);

*counter.iter().max().unwrap()
}

fn total_distance(coordinates: &[(u32, u32)], position: (u32, u32)) -> u32 {
coordinates.iter().map(|&z| distance(position, z)).sum()
}

fn part_two(coordinates: &[(u32, u32)]) -> usize {
let (x_min, y_min, x_max, y_max) = bounds(coordinates);

(y_min..=y_max)
.flat_map(|y| {
(x_min..=x_max).filter(move |&x| total_distance(coordinates, (x, y)) < MAX_TOTAL)
})
.count()
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-06-01.txt");

let coordinates = parse_input(path)?;

println!("Part 1: {}", part_one(&coordinates));
println!("Part 2: {}", part_two(&coordinates));

Ok(())
}

Finland the finnish puppy Ahtari, Etela-Pohjanmaa  No.2706203 

where
Dice rollRolled 1d10. Result: 10.

Porkistan ANUSOID Warragul, Ostrobothnia  No.2706249 +3 


Palestine, State of the palestinian pederast Khan Yunis, Gaza  No.2706260 

>>2706249
Welcome to Warragul United, Anus Rodi!

Palestine, State of the palestinian glaceon Khan Yunis, Gaza  No.2706289 

File: 1546516666176.jpg (941.41 KB, 3616x1560, 20190103_135039.jpg) ImgOps Exif Google

rate my haul /g/

Germany the german never haver Dresden, Sachsen  No.2706299 

>>2706289
does this one have an audio jack?

Palestine, State of the palestinian idiot retard Khan Yunis, Gaza  No.2706310 

>>2706299
no it's extremely basic

but the raspberry pi has one

also audio via hdmi

Turkey Many Rivers to Cross Zonguldak, Zonguldak  No.2706313 

>>2706310
how bad is raspi @ btc mining mene?

Palestine, State of the palestinian hlbk Khan Yunis, Gaza  No.2706315 +4 

>>2706313
if lola was an undertaking

Germany the german christcuck Dresden, Sachsen  No.2706321 

>>2706313
i think back when humanity still had the last privacy hope

lots of distributed network fags and piratebay guys wanted to make balloon nodes using them (from GER/SWE)

i don't think it ever happened judging how terry and ian are both dead now

Netherlands Advanced  No.2708349 

File: 1546632814222.gif (246.32 KB, 674x406, atom addon.gif) ImgOps Google

rate my koding setup

Palestine, State of the palestinian mammal Khan Yunis, Gaza  No.2708728 

File: 1546641461294.txt (4.83 KB, input-07-01.txt)

day 7:
use std::collections::HashSet;
use std::fmt;
use std::fs::File;
use std::io::{prelude::*, BufReader, Error as IoError};
use std::iter;
use std::path::Path;

use regex::Regex;

const ALPHABET_SIZE: usize = 26;
const BASE_TIME: usize = 61;
const WORKER_POOL: usize = 5;

#[derive(Debug)]
enum Error {
Io(IoError),
Invalid,
}

impl From<IoError> for Error {
fn from(e: IoError) -> Self {
Error::Io(e)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::Invalid => write!(f, "invalid input"),
}
}
}

fn parse_input(path: &Path) -> Result<(Vec<Vec<usize>>, Vec<Option<HashSet<usize>>>), Error> {
let re = Regex::new(
r"Step (?P<blocker>[A-Z]) must be finished before step (?P<waiter>[A-Z]) can begin.",
)
.unwrap();

let mut waiters: Vec<_> = iter::repeat(Vec::new()).take(ALPHABET_SIZE).collect();
let mut blockers: Vec<_> = iter::repeat(None).take(ALPHABET_SIZE).collect();

let errors = BufReader::new(File::open(path)?)
.lines()
.map(|line| {
line.map_err(|e| e.into())
.and_then(|s| match re.captures(&s) {
Some(cap) => {
let blocker = (cap["blocker"].as_bytes()[0] - b'A') as usize;
let waiter = (cap["waiter"].as_bytes()[0] - b'A') as usize;
waiters[blocker].push(waiter);
blockers[blocker].get_or_insert(HashSet::new());
blockers[waiter]
.get_or_insert(HashSet::new())
.insert(blocker);
Ok(())
}
None => Err(Error::Invalid),
})
})
.find(|r| r.is_err());

match errors {
Some(Err(e)) => Err(e),
_ => Ok((waiters, blockers)),
}
}

fn try_next(blockers: &mut [Option<HashSet<usize>>]) -> Option<usize> {
blockers
.iter_mut()
.enumerate()
.find(|(_, blocker)| match blocker {
Some(e) => e.is_empty(),
None => false,
})
.map(|(i, _)| i)
}

fn extract(i: usize, waiters: &[Vec<usize>], blockers: &mut [Option<HashSet<usize>>]) -> char {
for &j in waiters[i].iter() {
blockers[j].as_mut().unwrap().remove(&i);
}

(i as u8 + b'A') as char
}

fn part_one(waiters: &[Vec<usize>], blockers: &mut [Option<HashSet<usize>>]) -> String {
let mut output = String::with_capacity(6);

for _ in 0..ALPHABET_SIZE {
let i = try_next(blockers).unwrap();

blockers[i] = None;

output.push(extract(i, waiters, blockers));
}

output
}

fn part_two(waiters: &[Vec<usize>], blockers: &mut [Option<HashSet<usize>>]) -> (String, usize) {
let mut output = String::with_capacity(ALPHABET_SIZE);

let mut workers = [None; WORKER_POOL];

let mut time = 0;

loop {
let (free, t) = workers
.iter_mut()
.enumerate()
.map(|(i, worker)| match *worker {
Some((id, t)) if t <= time => {
*worker = None;
output.push(extract(id, waiters, blockers));
(i, 0)
}
Some((_, t)) => (i, t - time),
None => (i, 0),
})
.fold((None, !0), |(free, time), (i, t)| {
if t == 0 {
(Some(i), time)
} else if time > t {
(free, t)
} else {
(free, time)
}
});

match (free, try_next(blockers)) {
(None, _) | (_, None) => {
if t == !0 {
break;
}
time += t
}
(Some(free), Some(next)) => {
blockers[next] = None;
workers[free] = Some((next, time + BASE_TIME + next))
}
}
}

(output, time)
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-07-01.txt");

let (waiters, mut blockers) = parse_input(path)?;

println!("Part 1: {}", part_one(&waiters, &mut blockers.clone()));
println!("Part 2: {:?}", part_two(&waiters, &mut blockers));

Ok(())
}

United States the american futanari Madison, Wisconsin  No.2708948 +3 

File: 1546649058219.mp4 (964.65 KB, 1280x720, brainless sissy.mp4) ImgOps Google


United States the american tranny Madison, Wisconsin  No.2708953 

amber roberts the poster

Palestine, State of the palestinian bearmode Khan Yunis, Gaza  No.2709116 

File: 1546658684415.txt (35.15 KB, input-08-01.txt)

day 8:

use std::fmt;
use std::fs::File;
use std::io::{prelude::*, BufReader, Error as IoError};
use std::num::ParseIntError;
use std::path::Path;
use std::string::FromUtf8Error;

#[derive(Debug)]
struct Node {
children: Vec<Node>,
metadata: Vec<u8>,
}

#[derive(Debug)]
enum Error {
Io(IoError),
ParseInt(ParseIntError),
FromUtf8(FromUtf8Error),
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::ParseInt(e) => fmt::Display::fmt(e, f),
Error::FromUtf8(e) => fmt::Display::fmt(e, f),
}
}
}

fn populate(vec: &[u8]) -> (Node, usize) {
let (child_len, meta_len) = (vec[0] as usize, vec[1] as usize);
let mut children = Vec::with_capacity(child_len);
let mut metadata = vec![0; meta_len];
let mut len = 2;

for _ in 0..child_len {
let (child, l) = populate(&vec[len..]);

children.push(child);
len += l;
}

let total = len + meta_len;
metadata.copy_from_slice(&vec[len..total]);

(Node { children, metadata }, total)
}

fn parse_input(path: &Path) -> Result<Node, Error> {
let vec: Result<Vec<_>, _> = BufReader::new(File::open(path).map_err(Error::Io)?)
.split(b' ')
.map(|result| {
result
.map_err(Error::Io)
.and_then(|vec| String::from_utf8(vec).map_err(Error::FromUtf8))
.and_then(|s| s.trim().parse().map_err(Error::ParseInt))
})
.collect();

let (node, _) = populate(&vec?);

Ok(node)
}

fn metadata_sum(node: &Node) -> u32 {
node.metadata
.iter()
.cloned()
.fold(0, |sum, x| sum + u32::from(x))
}

fn simple_sum(node: &Node) -> u32 {
metadata_sum(node) + node.children.iter().map(simple_sum).sum::<u32>()
}

fn complex_sum(node: &Node) -> u32 {
match node.children.len() {
0 => metadata_sum(node),
l => node
.metadata
.iter()
.cloned()
.filter_map(|x| {
let x = x as usize;

if x > 0 && x <= l {
Some(&node.children[x - 1])
} else {
None
}
})
.map(complex_sum)
.sum(),
}
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-08-01.txt");

let root = parse_input(path)?;

println!("Part 1: {}", simple_sum(&root));
println!("Part 2: {}", complex_sum(&root));

Ok(())
}

Palestine, State of the palestinian summerfag Khan Yunis, Gaza  No.2710916 +1 

day 9:

input:
473 players; last marble is worth 70904 points


use std::fmt;
use std::fs::File;
use std::io::{prelude::*, Error as IoError};
use std::iter;
use std::mem;
use std::path::Path;

use regex::Regex;

struct Marble {
next: usize,
prev: usize,
}

struct Circle {
marbles: Vec<Marble>,
current: usize,
}

impl Circle {
fn new(marbles: usize) -> Self {
let mut marbles = Vec::with_capacity(marbles);

marbles.push(Marble { next: 0, prev: 0 });

Circle {
marbles,
current: 0,
}
}

fn play(&mut self) -> (usize, usize) {
let new = self.marbles.len();

if new % 23 == 0 {
self.marbles.push(Marble { next: 0, prev: 0 });
(new, new + self.remove())
} else {
self.insert(new);

(new, 0)
}
}

fn insert(&mut self, new: usize) {
let prev = self.marbles[self.current].next;

let next = mem::replace(&mut self.marbles[prev].next, new);

self.marbles.push(Marble { next, prev });

self.marbles[next].prev = new;

self.current = new;
}

fn remove(&mut self) -> usize {
let removed = (0..7).fold(self.current, |x, _| self.marbles[x].prev);

let Marble { next, prev } = self.marbles[removed];

self.marbles[next].prev = prev;
self.marbles[prev].next = next;

self.current = next;

removed
}
}

#[derive(Debug)]
enum Error {
Io(IoError),
Invalid,
}

impl From<IoError> for Error {
fn from(error: IoError) -> Self {
Error::Io(error)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::Invalid => write!(f, "invalid input"),
}
}
}

fn parse_input(path: &Path) -> Result<(usize, usize), Error> {
let s = &mut String::new();

File::open(path)?.read_to_string(s)?;

let caps =
Regex::new("(?P<players>[0-9]+) players; last marble is worth (?P<marbles>[0-9]+) points")
.unwrap()
.captures(s)
.ok_or(Error::Invalid)?;

Ok((
caps["players"].parse().unwrap(),
caps["marbles"].parse().unwrap(),
))
}

fn play(players: usize, marbles: usize) -> usize {
let mut scores = vec![0; players];
let mut circle = Circle::new(marbles);

iter::repeat_with(|| circle.play())
.take(marbles)
.map(|(marble, score)| {
let player = marble % players;
scores[player] += score;

scores[player]
})
.max()
.unwrap()
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-09-01.txt");

let (players, marbles) = parse_input(path)?;

println!("Part 1: {}", play(players, marbles));
println!("Part 2: {}", play(players, marbles * 100));

Ok(())
}

Palestine, State of the palestinian moralfag Khan Yunis, Gaza  No.2712506 +1 

File: 1546827541767.txt (15.55 KB, input-10-01.txt)

day 10:

use std::fmt;
use std::fs::File;
use std::io::{prelude::*, BufReader, Error as IoError};
use std::path::Path;

use regex::Regex;

#[derive(Debug)]
enum Error {
Io(IoError),
Invalid,
}

struct Edges {
min_x: i32,
min_y: i32,
max_x: i32,
max_y: i32,
}

impl Edges {
fn area(&self) -> (usize, usize) {
(
(self.max_x - self.min_x + 1) as usize,
(self.max_y - self.min_y + 1) as usize,
)
}
}

struct Position {
x: i32,
y: i32,
}

impl Position {
fn index(&self, edges: &Edges) -> usize {
let row = (edges.max_x - edges.min_x + 2) as usize;

let x = (self.x - edges.min_x) as usize;
let y = (self.y - edges.min_y) as usize;

y * row + x
}
}

struct Velocity {
x: i32,
y: i32,
}

struct Signal {
position: Position,
velocity: Velocity,
}

impl Signal {
fn at(&self, time: i32) -> Position {
Position {
x: self.position.x + self.velocity.x * time,
y: self.position.y + self.velocity.y * time,
}
}
}

impl From<IoError> for Error {
fn from(error: IoError) -> Self {
Error::Io(error)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::Invalid => write!(f, "invalid input"),
}
}
}

fn parse_input(path: &Path) -> Result<Vec<Signal>, Error> {
let re = Regex::new(
r"(?x)
position=<\s*
(?P<x>-?[0-9]+),\s+
(?P<y>-?[0-9]+)>\s
velocity=<\s*
(?P<v_x>-?[0-9]+),\s+
(?P<v_y>-?[0-9]+)>",
)
.unwrap();

BufReader::new(File::open(path)?)
.lines()
.map(|line| {
line.map_err(|e| e.into()).and_then(|s| {
re.captures(&s).ok_or(Error::Invalid).map(|cap| Signal {
position: Position {
x: cap["x"].parse().unwrap(),
y: cap["y"].parse().unwrap(),
},
velocity: Velocity {
x: cap["v_x"].parse().unwrap(),
y: cap["v_y"].parse().unwrap(),
},
})
})
})
.collect()
}

fn find_min_area(signals: &[Signal]) -> (i32, Edges) {
(0..)
.scan(!0, |area_prev, t| {
let edges = find_edges(signals, t);
let (row, col) = edges.area();
let area = row * col;

if area < *area_prev {
*area_prev = area;
Some((t, edges))
} else {
None
}
})
.last()
.unwrap()
}

fn find_edges(signals: &[Signal], time: i32) -> Edges {
let (min_x, min_y, max_x, max_y) = signals.iter().map(|signal| signal.at(time)).fold(
(
i32::max_value(),
i32::max_value(),
i32::min_value(),
i32::min_value(),
),
|(min_x, min_y, max_x, max_y), Position { x, y }| {
(
if x < min_x { x } else { min_x },
if y < min_y { y } else { min_y },
if x > max_x { x } else { max_x },
if y > max_y { y } else { max_y },
)
},
);

Edges {
min_x,
min_y,
max_x,
max_y,
}
}

fn draw(signals: &[Signal], time: i32, edges: &Edges) -> String {
let (row, col) = edges.area();

let mut v = Vec::with_capacity((row + 1) * col);

for _ in 0..col {
for _ in 0..row {
v.push(b'.');
}

v.push(b'\n');
}

for signal in signals {
v[signal.at(time).index(edges)] = b'#';
}

String::from_utf8(v).unwrap()
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-10-01.txt");

let signals = parse_input(path)?;

let (t, edges) = find_min_area(&signals);

print!("Part 1:\n{}", draw(&signals, t, &edges));
println!("Part 2: {}", t);

Ok(())
}

Netherlands zlatan lion big respect Diemen, Noord-Holland  No.2712525 +6 

ok but what about bronnen 2.0

United States Osama's Fifth Wife Center Moriches, New York  No.2712559 +1 

>>2712525
That's only for the kickstarter backers

Palestine, State of the palestinian incel Khan Yunis, Gaza  No.2712923 

>>2712525
in a famous albanian's words: pay me

Turkey cringe pilavı Ankara, Ankara  No.2713338 +5 

File: 1546886491337-0.png (495.3 KB, 474x569, Ekran Alıntısı.PNG) ImgOps Google

File: 1546886491337-1.png (530.21 KB, 460x587, Ekran Alıntısı2.PNG) ImgOps Google

File: 1546886491337-2.png (114.23 KB, 484x401, ekran alıntısı 3.PNG) ImgOps Google

File: 1546886491337-3.png (155.22 KB, 468x442, ekran alıntısı 4.PNG) ImgOps Google

File: 1546886491337-4.png (86.75 KB, 448x273, cuck.PNG) ImgOps Google


Palestine, State of the palestinian modi chaiwala Khan Yunis, Gaza  No.2714316 +1 

day 11:

const SIZE: usize = 300;
const INPUT: usize = 9005;

fn calculate(x: usize, y: usize) -> i8 {
let rack_id = x + 11;
(((rack_id * y + rack_id + INPUT) * rack_id) % 1000 / 100) as i8 - 5
}

fn populate(grid: &mut [[i8; SIZE]; SIZE]) {
for (y, row) in grid.iter_mut().enumerate() {
for (x, cell) in row.iter_mut().enumerate() {
*cell = calculate(x, y);
}
}
}

fn sum(grid: &[[i8; SIZE]; SIZE], x: usize, y: usize, size: usize) -> i32 {
grid.iter()
.skip(y)
.take(size)
.flat_map(|y| y.iter().skip(x).take(size).cloned().map(i32::from))
.sum()
}

fn part_one(grid: &[[i8; SIZE]; SIZE]) -> (usize, usize) {
let size = 2;

let (x, y) = (0..SIZE - size)
.flat_map(|y| (0..SIZE - size).map(move |x| (x, y)))
.max_by_key(|&(x, y)| sum(grid, x, y, size + 1))
.unwrap();

(x + 1, y + 1)
}

fn part_two(grid: &[[i8; SIZE]; SIZE]) -> (usize, usize, usize) {
let (x, y, size) = (0..SIZE)
.flat_map(|size| {
(0..SIZE - size).flat_map(move |y| (0..SIZE - size).map(move |x| (x, y, size)))
})
.max_by_key(|&(x, y, size)| sum(grid, x, y, size + 1))
.unwrap();

(x + 1, y + 1, size + 1)
}

fn main() {
let mut grid = [[0i8; SIZE]; SIZE];

populate(&mut grid);

println!("Part 1: {:?}", part_one(&grid));
println!("Part 2: {:?}", part_two(&grid));
}

Palestine, State of the palestinian alex jones Khan Yunis, Gaza  No.2714339 

File: 1546913376261-0.png (183.43 KB, 1920x1200, ClipboardImage.png) ImgOps Google

File: 1546913376261-1.png (233.38 KB, 1920x1200, ClipboardImage.png) ImgOps Google

File: 1546913376261-2.png (85.07 KB, 1331x440, ClipboardImage.png) ImgOps Google


Palestine, State of the palestinian modi chaiwala Khan Yunis, Gaza  No.2714342 


Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2714372 


Germany the german ostrobothnia Berlin, Berlin  No.2714381 

>>2713338
The 841st fasted growing company in the US

Palestine, State of the palestinian chad Khan Yunis, Gaza  No.2715906 

File: 1547004071278.txt (469 B, input-12-01.txt)

day 12:

use std::fmt;
use std::fs::File;
use std::io::{prelude::*, BufReader, Error as IoError};
use std::path::Path;

const TABLE: usize = 1 << 5;
const MASK: usize = 0b0001_1111;
const GEN_1: usize = 20;
const GEN_2: usize = 50_000_000_000;

#[derive(Debug)]
enum Error {
Io(IoError),
Invalid,
}

impl From<IoError> for Error {
fn from(error: IoError) -> Self {
Error::Io(error)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::Invalid => write!(f, "invalid input"),
}
}
}

fn parse_input(path: &Path) -> Result<(Vec<u8>, [u8; TABLE]), Error> {
let mut buf = BufReader::new(File::open(path)?).lines();

let s = match buf.next() {
Some(Ok(s)) => {
if s.len() > 17 {
s
} else {
return Err(Error::Invalid);
}
}
Some(Err(e)) => return Err(e.into()),
None => return Err(Error::Invalid),
};

let s = &s[15..];

let mut initial = Vec::with_capacity(s.len());

for b in s.bytes() {
match b {
b'.' => initial.push(0),
b'#' => initial.push(1),
_ => return Err(Error::Invalid),
}
}

let mut table = [0u8; TABLE];

for s in buf.skip(1).take(TABLE) {
let s = s?;

match s.bytes().nth(9) {
Some(b'.') => continue,
Some(b'#') => (),
_ => return Err(Error::Invalid),
}

let mut index = 0;

for b in s.bytes().take(5) {
index <<= 1;

match b {
b'.' => (),
b'#' => index |= 1,
_ => return Err(Error::Invalid),
}
}
table[index] = 1;
}

Ok((initial, table))
}

fn advance(prev: &[u8], table: &[u8; TABLE]) -> (Vec<u8>, i64) {
let mut next = Vec::with_capacity(prev.len() + 4);
let mut index = 0;
let mut first = false;
let mut shift = -2;

for &x in prev.iter().chain([0, 0, 0, 0].iter()) {
index = index << 1 | x as usize;

match (first, table[index & MASK]) {
(false, 1) => {
first = true;
next.push(1);
}
(true, x) => next.push(x),
_ => shift += 1,
}
}

while next.last() == Some(&0) {
next.pop();
}

(next, shift)
}

fn evolve(initial: &[u8], table: &[u8; TABLE], generations: usize) -> i64 {
let mut shift = 0;
let mut vec = Vec::from(initial);

for i in 0..generations {
let (v, s) = advance(&vec, table);

if vec == v {
shift += (generations - i) as i64 * s;
break;
}

shift += s;

vec = v;
}

vec.iter()
.enumerate()
.filter_map(|(i, &x)| if x == 1 { Some(i as i64 + shift) } else { None })
.sum()
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-12-01.txt");

let (initial, table) = parse_input(path)?;

println!("Part 1: {:?}", evolve(&initial, &table, GEN_1));
println!("Part 2: {:?}", evolve(&initial, &table, GEN_2));

Ok(())
}

Palestine, State of the palestinian masturbati Khan Yunis, Gaza  No.2716791 

File: 1547070114823.txt (22.12 KB, input-13-01.txt)

day 13:

use std::cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd};
use std::collections::HashSet;
use std::fmt;
use std::fs::File;
use std::io::{Error as IoError, Read};
use std::path::Path;
use std::str::FromStr;

use self::Direction::*;
use self::NextTurn::*;
use self::Object::*;

#[derive(Debug)]
enum Error {
Io(IoError),
Invalid(String),
}

impl From<IoError> for Error {
fn from(error: IoError) -> Self {
Error::Io(error)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::Invalid(s) => write!(f, "invalid input: {}", s),
}
}
}

enum Object {
Empty,
Horizontal,
Vertical,
NWSEEdge,
NESWEdge,
Intersection,
}

#[derive(Clone)]
enum Direction {
North,
West,
East,
South,
}

#[derive(Clone)]
enum NextTurn {
Left,
Straight,
Right,
}

#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Copy, Hash)]
struct Position {
y: usize,
x: usize,
}

impl fmt::Display for Position {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{},{}", self.x, self.y)
}
}

#[derive(Clone)]
struct Cart {
position: Position,
direction: Direction,
next_turn: NextTurn,
}

impl PartialEq for Cart {
fn eq(&self, other: &Self) -> bool {
self.position.eq(&other.position)
}
}

impl Eq for Cart {}

impl PartialOrd for Cart {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.position.partial_cmp(&other.position)
}
}

impl Ord for Cart {
fn cmp(&self, other: &Self) -> Ordering {
self.position.cmp(&other.position)
}
}

impl Cart {
fn intersection(&mut self) -> &Direction {
self.direction = match (&self.direction, &self.next_turn) {
(West, Straight) | (North, Left) | (South, Right) => West,
(East, Straight) | (North, Right) | (South, Left) => East,
(North, Straight) | (West, Right) | (East, Left) => North,
(South, Straight) | (West, Left) | (East, Right) => South,
};

self.next_turn = match self.next_turn {
Left => Straight,
Straight => Right,
Right => Left,
};

&self.direction
}
}

struct Track {
objects: Vec<Object>,
carts: Vec<Option<Cart>>,
width: usize,
}

impl FromStr for Track {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
let bytes = s.as_bytes();

let width = match bytes.iter().enumerate().find(|&(_, &x)| x == b'\n') {
Some((i, _)) => i,
None => return Err(Error::Invalid(String::from("no newline found"))),
};

let mut objects = Vec::with_capacity(bytes.len());
let mut carts = Vec::new();

for (position, token) in bytes
.chunks_exact(width + 1)
.enumerate()
.flat_map(|(y, row)| {
row.iter()
.take(width)
.enumerate()
.map(move |(x, &token)| (Position { x, y }, token))
})
{
objects.push(match token {
b' ' => Empty,
b'-' => Horizontal,
b'|' => Vertical,
b'/' => NWSEEdge,
b'\\' => NESWEdge,
b'+' => Intersection,
b'^' => {
carts.push(Some(Cart {
position,
direction: North,
next_turn: Left,
}));

Vertical
}
b'v' => {
carts.push(Some(Cart {
position,
direction: South,
next_turn: Left,
}));

Vertical
}
b'<' => {
carts.push(Some(Cart {
position,
direction: West,
next_turn: Left,
}));

Horizontal
}
b'>' => {
carts.push(Some(Cart {
position,
direction: East,
next_turn: Left,
}));

Horizontal
}
inv => {
return Err(Error::Invalid(format!(
"invalid character: {} at position: ({}, {})",
char::from(inv),
position.x,
position.y
)))
}
});
}

Ok(Track {
objects,
carts,
width,
})
}
}

fn parse_input(path: &Path) -> Result<Track, Error> {
let mut s = String::new();
File::open(path)?.read_to_string(&mut s)?;

Ok(s.parse()?)
}

fn advance_single_cart(track: &mut Track, cart_id: usize) -> Option<Position> {
let cart = track.carts[cart_id].as_mut()?;

let object = track
.objects
.chunks_exact(track.width)
.nth(cart.position.y)?
.get(cart.position.x)?;

match (object, &cart.direction, &cart.next_turn) {
(Horizontal, West, _) => cart.position.x -= 1,
(Horizontal, East, _) => cart.position.x += 1,
(Vertical, North, _) => cart.position.y -= 1,
(Vertical, South, _) => cart.position.y += 1,
(NWSEEdge, North, _) | (NESWEdge, South, _) => {
cart.position.x += 1;
cart.direction = East;
}
(NWSEEdge, South, _) | (NESWEdge, North, _) => {
cart.position.x -= 1;
cart.direction = West;
}
(NWSEEdge, West, _) | (NESWEdge, East, _) => {
cart.position.y += 1;
cart.direction = South;
}
(NWSEEdge, East, _) | (NESWEdge, West, _) => {
cart.position.y -= 1;
cart.direction = North;
}
(Intersection, _, _) => match cart.intersection() {
West => cart.position.x -= 1,
East => cart.position.x += 1,
North => cart.position.y -= 1,
South => cart.position.y += 1,
},
_ => return None,
};

Some(cart.position)
}

fn simulate(mut track: Track) -> Option<()> {
let mut set = HashSet::with_capacity(track.carts.len());

for position in track
.carts
.iter()
.map(|cart| cart.as_ref().unwrap().position)
{
set.insert(position);
}

loop {
track.carts.sort_unstable();

for i in 0..track.carts.len() {
if track.carts[i] == None {
continue;
}
set.remove(&track.carts[i].as_ref().unwrap().position);

let position = advance_single_cart(&mut track, i)?;

if !set.insert(position) {
println!("Crash at: {}", position);
set.remove(&position);

for cart in track.carts.iter_mut() {
match cart {
Some(Cart { position: p, .. }) if position == *p => {
cart.take();
}
_ => (),
}
}

if set.len() == 1 {
let i = track
.carts
.iter()
.enumerate()
.find_map(|(i, cart)| cart.as_ref().map(|_| i))
.unwrap();

println!("Last cart at: {}", advance_single_cart(&mut track, i)?);

return Some(());
}
}
}
}
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-13-01.txt");

simulate(parse_input(path)?);

Ok(())
}

Netherlands Advanced  No.2716793 

600

Palestine, State of the palestinian bing bing wahoo Khan Yunis, Gaza  No.2716898 

day 14:

const INPUT: usize = 320_851;
const INPUT_ARRAY: [u8; 6] = [3, 2, 0, 8, 5, 1];

fn part_one() {
let mut recipes: Vec<u8> = vec![3, 7];
let mut first = 0;
let mut second = 1;

while recipes.len() < INPUT + 10 {
let sum = recipes[first] + recipes[second];

if sum < 10 {
recipes.push(sum);
} else {
recipes.push(1);
recipes.push(sum - 10);
}

first = (first + (recipes[first] + 1) as usize) % recipes.len();
second = (second + (recipes[second] + 1) as usize) % recipes.len();
}

print!("Part 1: ");
for x in recipes.iter().skip(INPUT).take(10).cloned() {
print!("{}", x);
}
println!();
}

fn compare(recipes: &[u8]) -> bool {
INPUT_ARRAY == recipes[recipes.len() - INPUT_ARRAY.len()..]
}

fn part_two() {
let mut recipes: Vec<u8> = vec![3, 7, 1, 0, 1, 0, 1, 2, 4, 5];
let mut first = 6;
let mut second = 3;

loop {
let sum = recipes[first] + recipes[second];
if sum < 10 {
recipes.push(sum);

if compare(&recipes) {
break;
}
} else {
recipes.push(1);
if compare(&recipes) {
break;
}

recipes.push(sum - 10);
if compare(&recipes) {
break;
}
}

first = (first + (recipes[first] + 1) as usize) % recipes.len();
second = (second + (recipes[second] + 1) as usize) % recipes.len();
}

println!("Part 2: {}", recipes.len() - INPUT_ARRAY.len());
}

fn main() {
part_one();
part_two();
}

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2717035 +6 

File: 1547086011661.png (1.05 MB, 1377x1025, ClipboardImage.png) ImgOps Google


Palestine, State of the palestinian mammal Khan Yunis, Gaza  No.2717057 

>>2717035
hehehe this is sooo me

Palestine, State of the palestinian cohen Khan Yunis, Gaza  No.2717397 

Lars Brunjes, Director of Education at IOHK, is currently teaching Ethiopian and Ugandan women Haskell for the next two months! Check out this article with Computer Weekly where he explains what it means to be a blockchain developer:
https://www.computerweekly.com/blog/CW-Developer-Network/What-makes-a-blockchain-developer

Porkistan ANUSOID Warragul, Ostrobothnia  No.2718470 

>>2717397
This is powerful

United States Osama's Fifth Wife Center Moriches, New York  No.2718479 

File: 1547168957431.jpg (30.32 KB, 750x302, stefan.jpg) ImgOps Exif Google

>>2717397
Reminds me of this

Netherlands Advanced  No.2718490 +6 

File: 1547169758332.png (216.58 KB, 538x355, neo-nazi wealth.png) ImgOps Google


United States Osama's Fifth Wife Center Moriches, New York  No.2718501 

File: 1547170176966.jpg (18.47 KB, 240x236, doublethinker pondercombo.jpg) ImgOps Exif Google

>>2718490
That tweet was made just a moments after bitcoin started plummeting to the ground last(pretend we're still in december) year
He's enough of a sociopath to have strategically posted that

Netherlands Advanced  No.2719401 

File: 1547228550960.jpg (1.22 MB, 4032x3024, hm6cc2xpyn921.jpg) ImgOps Exif Google

what do /g/ ?

Italy the italian summerfag Torino, Piemonte  No.2719406 +3 

>>2719401
dont close it please

United States idiotretard Bismarck, North Dakota  No.2719422 +1 

>>2719401
Close the lid because servers are meant to be headless and behind a door for anything worth keeping up

United States the american individual 1 New Berlin, Wisconsin  No.2719424 +2 

>>2719401
its probably just a minecraft server, close it

Finland Proxy the finnish pizza Helsinki, Uusimaa  No.2719432 +3 

>>2719401
please do not close the bronnen servers
Dice rollRolled 1d10. Result: 3.

Sweden the swedish alex jones Karlskoga, Orebro lan  No.2719439 +4 

>>2719401
Please close the bronnen servers

United States idiotretard Bismarck, North Dakota  No.2719450 

>>2719432
>>2719439
they cloud
they cloud

United States Osama's Fifth Wife Center Moriches, New York  No.2719669 +1 

>>2719450
then make it rain then bitch

Palestine, State of the palestinian fedora atheist Khan Yunis, Gaza  No.2719759 

aaa got tricked into writing a turn based roguelike

Round 40:
Goblin with 128 hit points
Goblin with 200 hit points
Goblin with 200 hit points
Goblin with 113 hit points
Goblin with 200 hit points
Goblin with 200 hit points
Elf with 83 hit points
Goblin with 5 hit points
Goblin with 200 hit points
Goblin with 200 hit points
Elf with 8 hit points
Goblin with 200 hit points
Goblin with 137 hit points
Goblin with 161 hit points
Goblin with 158 hit points
Elf with 161 hit points
Elf with 161 hit points
Goblin with 200 hit points
Goblin with 107 hit points
Elf with 20 hit points
Goblin with 200 hit points
Goblin with 113 hit points
Elf with 188 hit points
Goblin with 170 hit points
Elf with 74 hit points
Goblin with 200 hit points

################################
####################### ######
###################### #######
############## #### ########
############# ########
############ # #### ###
########### ## # ### ###
########## ### #
######### ## ### #
########### # ##
########### # # G G G ##
########## G #
##### ##### ##### G #
#### ##### ####### GEG ####
## #### ######### G GEG ##
# #### ######### G #
# #### #########GG #
## #### #########EE## #
### ### ######### G # ###
### ## ####### ####
### ##### #####
### GE ######
###### G GE ##
###### ### GE #
##### ## G #
##### # ## ## ##
####### ###### ## ##########
####### ######### ##########
###### ######### ########
#### ########### ########
#### # ########### ########
################################

Goblin with 128 hit points moves.
Goblin with 200 hit points moves.
Goblin with 200 hit points moves.
Goblin with 113 hit points moves.
Goblin with 200 hit points attacks Elf with 83 hit points.
Goblin with 200 hit points attacks Elf with 80 hit points.
Elf with 77 hit points attacks Goblin with 5 hit points.
Goblin with 2 hit points attacks Elf with 8 hit points.
Goblin with 200 hit points moves.
Goblin with 200 hit points attacks Elf with 5 hit points.
Elf with 2 hit points attacks Goblin with 2 hit points.
Goblin with 200 hit points attacks Elf with 2 hit points.
Goblin with 137 hit points moves.
Goblin with 161 hit points attacks Elf with 161 hit points.
Goblin with 158 hit points attacks Elf with 161 hit points.
Elf with 158 hit points attacks Goblin with 161 hit points.
Elf with 158 hit points attacks Goblin with 158 hit points.
Goblin with 200 hit points moves.
Goblin with 107 hit points attacks Elf with 20 hit points.
Elf with 17 hit points attacks Goblin with 107 hit points.
Goblin with 200 hit points moves.
Goblin with 113 hit points attacks Elf with 17 hit points.
Elf with 188 hit points attacks Goblin with 113 hit points.
Goblin with 170 hit points attacks Elf with 74 hit points.
Elf with 71 hit points attacks Goblin with 170 hit points.
Goblin with 200 hit points attacks Elf with 71 hit points.

Canada the canadian avian Quebec, Quebec  No.2719790 

>>2719759
lola as NPC

United States idiotretard Bismarck, North Dakota  No.2719797 

>>2719759
please implement a alphabetic naming system for these number creatura

Goblin A, Goblin B, Elf A, etc.

Palestine, State of the palestinian puppy Khan Yunis, Gaza  No.2719846 

>>2719797
i was just debugging

it's from https://adventofcode.com/2018/day/15

it done

Palestine, State of the palestinian cbronnenite Khan Yunis, Gaza  No.2719849 

File: 1547246202725.txt (1.03 KB, input-15-01.txt)

day 15:

use std::fmt;
use std::fs::File;
use std::io::{Error as IoError, Read};
use std::ops::{Index, IndexMut};
use std::path::Path;
use std::str::FromStr;

use self::Action::*;
use self::Direction::*;
use self::Entity::*;
use self::Target::*;

const UNREACHABLE: u8 = u8::max_value();
const DIRECTIONS: [Direction; 4] = [North, West, East, South];
const HP: HitPoints = HitPoints(200);
const GOBLIN_AP: u8 = 3;

#[derive(Debug)]
enum Error {
Io(IoError),
Invalid(String),
}

impl From<IoError> for Error {
fn from(error: IoError) -> Self {
Error::Io(error)
}
}

impl From<&str> for Error {
fn from(error: &str) -> Self {
Error::Invalid(error.into())
}
}

impl From<String> for Error {
fn from(error: String) -> Self {
Error::Invalid(error)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::Invalid(s) => write!(f, "invalid input: {}", s),
}
}
}

#[derive(Debug, Ord, PartialOrd, Eq, PartialEq, Clone)]
struct HitPoints(u8);

impl HitPoints {
fn hit(&mut self, ap: u8) -> bool {
match self.0.overflowing_sub(ap) {
(0, _) | (_, true) => {
self.0 = 0;
true
}
(new, _) => {
self.0 = new;
false
}
}
}
}

#[derive(Debug, Clone)]
enum Entity {
Empty,
Wall,
Elf(HitPoints),
Goblin(HitPoints),
}

impl fmt::Display for Entity {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Empty => write!(f, "Empty Space"),
Wall => write!(f, "Wall"),
Elf(hp) => write!(f, "Elf with {} hit points", hp.0),
Goblin(hp) => write!(f, "Goblin with {} hit points", hp.0),
}
}
}

impl Entity {
fn die(&mut self) {
*self = Empty;
}
}

enum Direction {
North,
West,
East,
South,
}

enum Target {
Found(Position),
NotFound(u32, bool),
Unreachable,
}
#[derive(Debug)]
enum Action {
Wait,
Attack(Position),
Move,
}

#[derive(Debug, Copy, Clone)]
struct Position(usize);

impl Position {
fn to(self, width: usize, direction: &Direction) -> Option<Self> {
match direction {
North => self.0.checked_sub(width).map(Position),
West if self.0 % width != 0 => self.0.checked_sub(1).map(Position),
East if self.0 % width != width - 1 => self.0.checked_add(1).map(Position),
South => self.0.checked_add(width).map(Position),
_ => None,
}
}
}

#[derive(Debug)]
struct Board {
entities: Vec<Entity>,
elf_ap: u8,
width: usize,
}

impl FromStr for Board {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
let bytes = s.as_bytes();

let width = match bytes.iter().enumerate().find(|&(_, &x)| x == b'\n') {
Some((i, _)) => i,
None => bytes.len(),
};

match bytes.iter().find_map(|&x| match x {
b'.' | b'#' | b'G' | b'E' | b'\n' => None,
x => Some(x),
}) {
None => Ok(()),
Some(x) => Err(format!("invalid character: {}", char::from(x),)),
}?;

let mut entities = Vec::with_capacity(bytes.len());

entities.extend(bytes.iter().filter_map(|&x| match x {
b'.' => Some(Empty),
b'#' => Some(Wall),
b'G' => Some(Goblin(HP)),
b'E' => Some(Elf(HP)),
_ => None,
}));

Ok(Board {
entities,
elf_ap: 3,
width,
})
}
}

impl fmt::Display for Board {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
for y in self.entities.chunks_exact(self.width) {
for x in y.iter() {
match x {
Goblin(_) => write!(f, "G"),
Elf(_) => write!(f, "E"),
Wall => write!(f, "#"),
Empty => write!(f, "."),
}?;
}

writeln!(f)?;
}

Ok(())
}
}

impl Index<Position> for [u8] {
type Output = u8;

fn index(&self, index: Position) -> &Self::Output {
&self[index.0]
}
}

impl IndexMut<Position> for [u8] {
fn index_mut(&mut self, index: Position) -> &mut Self::Output {
&mut self[index.0]
}
}

impl Index<Position> for Vec<Entity> {
type Output = Entity;

fn index(&self, index: Position) -> &Self::Output {
&self[index.0]
}
}

impl IndexMut<Position> for Vec<Entity> {
fn index_mut(&mut self, index: Position) -> &mut Self::Output {
&mut self[index.0]
}
}

impl Board {
fn calculate_turn_order(&mut self, turn_order: &mut Vec<Position>) {
turn_order.clear();

turn_order.extend(self.entities.iter().enumerate().filter_map(
|(i, entity)| match entity {
Elf(_) | Goblin(_) => Some(Position(i)),
_ => None,
},
));
}

fn move_to(&mut self, old: Position, new: Position) {
self.entities.swap(old.0, new.0);
}

fn attack(&mut self, position: Position) -> bool {
let victim = &mut self.entities[position];

match victim {
Goblin(hp) => {
if hp.hit(self.elf_ap) {
victim.die();
}
false
}
Elf(hp) => {
if hp.hit(GOBLIN_AP) {
victim.die();
true
} else {
false
}
}
entity => panic!("attempting to attack {}", entity,),
}
}

fn pick_action(&self, position: Position) -> Action {
let elf = match self.entities[position] {
Elf(_) => true,
Goblin(_) => false,
_ => return Wait,
};

let mut can_move = false;

let target = DIRECTIONS
.iter()
.filter_map(|direction| {
match (
position
.to(self.width, direction)
.map(|position| (position, &self.entities[position])),
elf,
) {
(Some((position, Goblin(hp))), true) | (Some((position, Elf(hp))), false) => {
Some((hp, position))
}
(Some((_, Empty)), _) => {
can_move = true;
None
}
_ => None,
}
})
.min_by_key(|(hp, _)| hp.0)
.map(|(_, position)| position);

match (target, can_move) {
(Some(position), _) => Attack(position),
(None, true) => Move,
_ => Wait,
}
}

fn calculate_path(&self, position: Position, distance: u8, pathfinding: &mut [u8]) {
pathfinding[position] = distance;

for direction in DIRECTIONS.iter() {
match position
.to(self.width, direction)
.map(|position| (position, &self.entities[position], pathfinding[position]))
{
Some((position, Empty, new_dist)) if new_dist > distance + 1 => {
self.calculate_path(position, distance + 1, pathfinding)
}
_ => (),
}
}
}

fn update_paths(&self, position: Position, pathfinding: &mut [u8]) {
for x in pathfinding.iter_mut() {
*x = UNREACHABLE;
}
self.calculate_path(position, 0, pathfinding);
}

fn remaining_hp(&self) -> u32 {
self.entities
.iter()
.filter_map(|entity| match entity {
Goblin(hp) | Elf(hp) => Some(u32::from(hp.0)),
_ => None,
})
.sum()
}

fn find_closest_target(&self, position: Position, pathfinding: &[u8]) -> Target {
let elf = match &self.entities[position] {
Elf(_) => true,
Goblin(_) => false,
entity => panic!("invalid entity {} for finding a target", entity),
};

match self
.entities
.iter()
.enumerate()
.filter_map(|(i, entity)| match (entity, elf) {
(Elf(_), false) | (Goblin(_), true) => Some(Position(i)),
_ => None,
})
.flat_map(|position| {
DIRECTIONS.iter().map(move |direction| {
if let Some((position, Empty)) = position
.to(self.width, direction)
.map(|position| (position, &self.entities[position]))
{
(position, pathfinding[position])
} else {
(position, UNREACHABLE)
}
})
})
.min_by_key(|(_, distance)| *distance)
{
Some((_, UNREACHABLE)) => Unreachable,
Some((position, _)) => Found(position),
None => NotFound(self.remaining_hp(), elf),
}
}

fn find_path_to_target(&self, target: Position, pathfinding: &[u8]) -> Position {
match DIRECTIONS
.iter()
.filter_map(|direction| {
target
.to(self.width, direction)
.map(|position| (position, pathfinding[position]))
})
.min_by_key(|(_, distance)| *distance)
.unwrap()
{
(_, 0) => target,
(position, _) => self.find_path_to_target(position, pathfinding),
}
}

fn simulate(&mut self, must_survive: bool) -> Option<(u32, u32, bool)> {
let turn_order = &mut Vec::new();
let pathfinding = &mut vec![0; self.entities.len()];
let mut round = 0;

let (hp, elf_victory) = 'outer: loop {
self.calculate_turn_order(turn_order);

for &position in turn_order.iter() {
match self.pick_action(position) {
Wait => (),
Attack(target) => {
if self.attack(target) && must_survive {
return None;
}
}
Move => {
self.update_paths(position, pathfinding);
match self.find_closest_target(position, pathfinding) {
Found(target) => {
let new_position = self.find_path_to_target(target, pathfinding);
self.move_to(position, new_position);
if let Attack(target) = self.pick_action(new_position) {
if self.attack(target) && must_survive {
return None;
}
}
}
Unreachable => (),
NotFound(hp, elf_victory) => break 'outer (hp, elf_victory),
}
}
}
}

round += 1;
};

Some((round, hp, elf_victory))
}
}

fn parse_input(path: &Path) -> Result<Board, Error> {
let mut s = String::new();
File::open(path)?.read_to_string(&mut s)?;

Ok(s.parse()?)
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-15-01.txt");

let mut board = parse_input(path)?;
let entities = board.entities.clone();

let (rounds, hp, elf_victory) = board.simulate(false).unwrap();

let victor = if elf_victory { "Elves" } else { "Goblins" };

println!("Results for Elves with {} attack power:", board.elf_ap);
println!("Combat ends after {} full rounds", rounds);
println!("{} win with {} total hit points left", victor, hp);
println!("Outcome: {} * {} = {}", rounds, hp, rounds * hp);
println!();

for ap in GOBLIN_AP + 1..=u8::max_value() {
let mut board = Board {
entities: entities.clone(),
width: board.width,
elf_ap: ap,
};

if let Some((rounds, hp, _)) = board.simulate(true) {
println!("Results for Elves with {} attack power:", board.elf_ap);
println!("Combat ends after {} full rounds", rounds);
println!("Elves win with {} total hit points left", hp);
println!("Outcome: {} * {} = {}", rounds, hp, rounds * hp);

return Ok(());
}
}

Err("Elves exceeded maximum attack power while still suffering casualties".into())
}

Palestine, State of the palestinian edgemaster Khan Yunis, Gaza  No.2719853 

god i love rust

Palestine, State of the palestinian gayboy Khan Yunis, Gaza  No.2721609 

File: 1547333476535.txt (46.77 KB, input-16-01.txt)

day 16:

use std::collections::HashSet;
use std::fmt;
use std::fs::File;
use std::io::{BufRead, BufReader, Error as IoError};
use std::iter;
use std::ops::{Index, IndexMut};
use std::path::Path;
use std::str::FromStr;

use lazy_static::lazy_static;
use regex::Regex;

const INSTRUCTION_COUNT: usize = 16;

type Instruction = fn(&mut Device, u32, u32, u32);
type InstructionSet = [Instruction; INSTRUCTION_COUNT];

const INSTRUCTIONS: InstructionSet = [
|dev, a, b, c| dev[c] = dev[a] + dev[b],
|dev, a, b, c| dev[c] = dev[a] + b,
|dev, a, b, c| dev[c] = dev[a] * dev[b],
|dev, a, b, c| dev[c] = dev[a] * b,
|dev, a, b, c| dev[c] = dev[a] & dev[b],
|dev, a, b, c| dev[c] = dev[a] & b,
|dev, a, b, c| dev[c] = dev[a] | dev[b],
|dev, a, b, c| dev[c] = dev[a] | b,
|dev, a, _, c| dev[c] = dev[a],
|dev, a, _, c| dev[c] = a,
|dev, a, b, c| dev[c] = if a > dev[b] { 1 } else { 0 },
|dev, a, b, c| dev[c] = if b < dev[a] { 1 } else { 0 },
|dev, a, b, c| dev[c] = if dev[a] > dev[b] { 1 } else { 0 },
|dev, a, b, c| dev[c] = if a == dev[b] { 1 } else { 0 },
|dev, a, b, c| dev[c] = if b == dev[a] { 1 } else { 0 },
|dev, a, b, c| dev[c] = if dev[a] == dev[b] { 1 } else { 0 },
];

#[derive(Debug)]
enum Error {
Io(IoError),
Invalid(String),
}

impl From<IoError> for Error {
fn from(error: IoError) -> Self {
Error::Io(error)
}
}

impl From<&str> for Error {
fn from(error: &str) -> Self {
Error::Invalid(error.into())
}
}

impl From<String> for Error {
fn from(error: String) -> Self {
Error::Invalid(error)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::Invalid(s) => write!(f, "invalid input: {}", s),
}
}
}

#[derive(Clone, Debug, Eq, PartialEq)]
struct Device([u32; 4]);

impl FromStr for Device {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
lazy_static! {
static ref RE: Regex =
Regex::new(r"(Before: |After: )\[(\d), (\d), (\d), (\d)]").unwrap();
}

let caps = match RE.captures(s) {
Some(caps) => caps,
None => return Err("unrecognized device signature".into()),
};

Ok(Device([
caps[2].parse().unwrap(),
caps[3].parse().unwrap(),
caps[4].parse().unwrap(),
caps[5].parse().unwrap(),
]))
}
}

impl Index<u32> for Device {
type Output = u32;

fn index(&self, idx: u32) -> &Self::Output {
&self.0[idx as usize]
}
}

impl IndexMut<u32> for Device {
fn index_mut(&mut self, idx: u32) -> &mut Self::Output {
&mut self.0[idx as usize]
}
}

#[derive(Debug)]
struct Operation {
opcode: usize,
a: u32,
b: u32,
c: u32,
}

impl FromStr for Operation {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
lazy_static! {
static ref RE: Regex = Regex::new(r"(\d{1,2}) (\d) (\d) (\d)").unwrap();
}

let caps = match RE.captures(s) {
Some(caps) => caps,
None => return Err("unrecognized operation signature".into()),
};

Ok(Operation {
opcode: caps[1].parse().unwrap(),
a: caps[2].parse().unwrap(),
b: caps[3].parse().unwrap(),
c: caps[4].parse().unwrap(),
})
}
}

#[derive(Debug)]
struct Data {
before: Device,
after: Device,
operation: Operation,
}

type Input = (Vec<Data>, Vec<Operation>);

fn parse_input(path: &Path) -> Result<Input, Error> {
let mut lines = BufReader::new(File::open(path)?).lines();
let mut data = Vec::new();

loop {
let before = match lines.next() {
Some(s) => match s?.as_ref() {
"" => break,
s => s.parse()?,
},
None => return Err("unexpected EOF".into()),
};

let operation = match lines.next() {
Some(s) => s?.parse()?,
None => return Err("unexpected EOF".into()),
};

let after = match lines.next() {
Some(s) => s?.parse()?,
None => return Err("unexpected EOF".into()),
};

data.push(Data {
before,
after,
operation,
});

lines.next();
}

lines.next();

let operations: Result<Vec<_>, _> = lines
.map(|result| result.map_err(Error::from).and_then(|s| s.parse()))
.collect();

Ok((data, operations?))
}

fn build_sets(data: &[Data]) -> (Vec<HashSet<usize>>, usize) {
let mut sets = Vec::with_capacity(INSTRUCTION_COUNT);
sets.extend(iter::repeat(HashSet::new()).take(INSTRUCTION_COUNT));

let count = data
.iter()
.filter(|data| {
INSTRUCTIONS
.iter()
.enumerate()
.filter_map(|(i, &op)| {
let mut device = data.before.clone();

op(
&mut device,
data.operation.a,
data.operation.b,
data.operation.c,
);

if device == data.after {
sets[i].insert(data.operation.opcode);
Some(())
} else {
None
}
})
.count()
> 2
})
.count();

(sets, count)
}

fn map_instructions(sets: &mut [HashSet<usize>]) -> Result<InstructionSet, Error> {
let mut transform = [0; 16];

for _ in 0..INSTRUCTION_COUNT {
let (i, opcode) = sets
.iter_mut()
.enumerate()
.find(|(_, set)| set.len() == 1)
.map(|(i, set)| (i, set.drain().next().unwrap()))
.ok_or("unsolveable data")?;

transform[opcode] = i;

for set in sets.iter_mut() {
set.remove(&opcode);
}
}

Ok([
INSTRUCTIONS[transform[0]],
INSTRUCTIONS[transform[1]],
INSTRUCTIONS[transform[2]],
INSTRUCTIONS[transform[3]],
INSTRUCTIONS[transform[4]],
INSTRUCTIONS[transform[5]],
INSTRUCTIONS[transform[6]],
INSTRUCTIONS[transform[7]],
INSTRUCTIONS[transform[8]],
INSTRUCTIONS[transform[9]],
INSTRUCTIONS[transform[10]],
INSTRUCTIONS[transform[11]],
INSTRUCTIONS[transform[12]],
INSTRUCTIONS[transform[13]],
INSTRUCTIONS[transform[14]],
INSTRUCTIONS[transform[15]],
])
}

fn execute_procedure(instructions: InstructionSet, operations: &[Operation]) -> Device {
let mut device = Device([0; 4]);

for operation in operations {
instructions[operation.opcode](&mut device, operation.a, operation.b, operation.c);
}

device
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-16-01.txt");

let (data, operations) = parse_input(path)?;

let (mut sets, count) = build_sets(&data);

println!("Part 1: {}", count);

let instructions = map_instructions(&mut sets)?;

let device = execute_procedure(instructions, &operations);

println!("Part 2: {}", device[0]);

Ok(())
}

Palestine, State of the palestinian hussy Khan Yunis, Gaza  No.2722780 


Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2723181 +4 

File: 1547416548198.png (305.39 KB, 572x594, Screenshot_2018-03-31-13-3….png) ImgOps Google

i was looking for info on how to create a QR code app, but people that browse stack overflow have some kind of issue that nerver give you a straight answer or show you the path to get better knowledge
they just say "oh, use that google api", or "you can just use that php module to generate a qr code in your server"

luckily ive found a tuttorial and i will take a further look into it to check if its useful

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2723423 

File: 1547434600860.png (142.94 KB, 1488x836, ClipboardImage.png) ImgOps Google

here we go

Porkistan ANUSOID Warragul, Ostrobothnia  No.2723557 

>>2722780
Common Lisp attracts the shinzos
Scheme attracts the BBC gods

Palestine, State of the palestinian mammal Khan Yunis, Gaza  No.2723896 

File: 1547477064286-0.txt (39.48 KB, input-17-01.txt)

File: 1547477064286-1.txt (715.26 KB, output.txt)

day 17:

rendered output available

use std::fmt;
use std::fs::File;
use std::io::{BufRead, BufReader, Error as IoError};
use std::num::ParseIntError;
use std::ops::Range;
use std::path::Path;
use std::str::FromStr;

const SPRING: usize = 500;

#[derive(Debug)]
enum Error {
Io(IoError),
ParseInt(ParseIntError),
Invalid(String),
}

impl From<IoError> for Error {
fn from(error: IoError) -> Self {
Error::Io(error)
}
}

impl From<ParseIntError> for Error {
fn from(error: ParseIntError) -> Self {
Error::ParseInt(error)
}
}

impl From<&str> for Error {
fn from(error: &str) -> Self {
Error::Invalid(error.into())
}
}

impl From<String> for Error {
fn from(error: String) -> Self {
Error::Invalid(error)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::ParseInt(e) => fmt::Display::fmt(e, f),
Error::Invalid(s) => write!(f, "invalid input: {}", s),
}
}
}

enum Blueprints {
Horizontal { x: Range<usize>, y: usize },
Vertical { x: usize, y: Range<usize> },
}

fn parse_num(s: &str, range: Range<usize>) -> Result<usize, Error> {
match s.get(range) {
Some(s) => s.parse().map_err(Error::from),
_ => Err(s.into()),
}
}

impl FromStr for Blueprints {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
let horizontal = match s.get(0..2) {
Some("x=") => false,
Some("y=") => true,
_ => return Err(s.into()),
};

let (comma, dot) = match (s.find(','), s.find('.')) {
(Some(c), Some(d)) if d > c => (c, d),
_ => return Err(s.into()),
};

match (s.get(comma..comma + 4), s.get(dot..dot + 2), horizontal) {
(Some(", x="), Some(".."), true) | (Some(", y="), Some(".."), false) => (),
_ => return Err(s.into()),
}

let num = parse_num(s, 2..comma)?;
let start = parse_num(s, comma + 4..dot)?;
let end = parse_num(s, dot + 2..s.len())? + 1;
let range = start..end;

Ok(if horizontal {
Blueprints::Horizontal { x: range, y: num }
} else {
Blueprints::Vertical { x: num, y: range }
})
}
}

fn parse_input(path: &Path) -> Result<Vec<Blueprints>, Error> {
BufReader::new(File::open(path)?)
.lines()
.map(|line| line.map_err(Error::from).and_then(|s| s.parse()))
.collect()
}

fn find_extremes(blueprints: &[Blueprints]) -> (usize, usize, usize, usize) {
blueprints.iter().fold(
(
usize::max_value(),
usize::max_value(),
usize::min_value(),
usize::min_value(),
),
|(x_ming, y_ming, x_maxg, y_maxg), blueprint| {
let (x_min, y_min, x_max, y_max) = match blueprint {
Blueprints::Vertical {
x,
y: Range { start, end },
} => (*x, *start, *x, *end - 1),
Blueprints::Horizontal {
x: Range { start, end },
y,
} => (*start, *y, *end - 1, *y),
};

(
if x_min < x_ming { x_min } else { x_ming },
if y_min < y_ming { y_min } else { y_ming },
if x_max > x_maxg { x_max } else { x_maxg },
if y_max > y_maxg { y_max } else { y_maxg },
)
},
)
}

#[derive(Eq, PartialEq, Copy, Clone, Debug)]
enum Object {
Sand,
Visited,
Clay,
Water,
}

impl fmt::Display for Object {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Object::Sand => write!(f, "."),
Object::Visited => write!(f, "|"),
Object::Clay => write!(f, "#"),
Object::Water => write!(f, "~"),
}
}
}

struct Map {
objects: Vec<Object>,
transposed: Vec<Object>,
depth: usize,
width: usize,
}

impl fmt::Display for Map {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut chunks = self.transposed.chunks_exact(self.width);

for &object in chunks.next().unwrap() {
write!(f, "{}", object)?;
}

for chunk in chunks {
writeln!(f)?;

for &object in chunk {
write!(f, "{}", object)?;
}
}

Ok(())
}
}

impl Map {
fn new(depth: usize, width: usize) -> Self {
let objects = vec![Object::Sand; depth * width];
let transposed = objects.clone();

Map {
objects,
transposed,
depth,
width,
}
}

fn index_to_tuple(&self, index: usize) -> (usize, usize) {
(index / self.depth, index % self.depth)
}

fn tuple_to_index(&self, tuple: (usize, usize)) -> usize {
tuple.0 * self.depth + tuple.1
}

fn index_to_tuple_transposed(&self, index: usize) -> (usize, usize) {
(index % self.width, index / self.width)
}

fn tuple_to_index_transposed(&self, tuple: (usize, usize)) -> usize {
tuple.1 * self.width + tuple.0
}

fn fall_down(&mut self, x: usize, y: usize) {
let start = self.tuple_to_index((x, y));
let bottom = self.tuple_to_index((x, self.depth));

if self.objects[start] != Object::Sand {
return;
}

let end = self.objects[start..bottom]
.iter()
.cloned()
.enumerate()
.find_map(|(i, object)| match object {
Object::Clay | Object::Water => Some(start + i),
_ => None,
});

for object in self.objects[start..end.unwrap_or(bottom)].iter_mut() {
*object = Object::Visited;
}

if let Some(end) = end {
let (x, y) = self.index_to_tuple(end - 1);
self.spread(x, y);
}
}

fn spread(&mut self, x: usize, y: usize) {
let left = self.tuple_to_index_transposed((0, y));
let middle = self.tuple_to_index_transposed((x, y));
let right = self.tuple_to_index_transposed((self.width, y));
let under = self.tuple_to_index_transposed((x, y + 1));
let end = self.tuple_to_index_transposed((self.width, y + 1));

let (left_end, left_object) = self.transposed[left..middle]
.iter()
.cloned()
.zip(self.transposed[right..under].iter().cloned())
.enumerate()
.rev()
.find_map(|(i, (object, below))| match (object, below) {
(Object::Clay, _)
| (Object::Sand, Object::Sand)
| (Object::Visited, Object::Sand) => Some((left + i + 1, object)),
_ => None,
})
.unwrap();

if left_object != Object::Visited {
for object in self.transposed[left_end..middle].iter_mut() {
*object = Object::Visited;
}

if left_object == Object::Sand {
let (x, _) = self.index_to_tuple_transposed(left_end - 1);

self.fall_down(x, y);
}
}

let (right_end, right_object) = self.transposed[middle..right]
.iter()
.cloned()
.zip(self.transposed[under..end].iter().cloned())
.enumerate()
.find_map(|(i, (object, below))| match (object, below) {
(Object::Clay, _) | (Object::Water, _) => Some((middle + i, Object::Clay)),
(Object::Sand, Object::Sand) | (Object::Visited, Object::Sand) => {
Some((middle + i, object))
}
_ => None,
})
.unwrap();

if right_object != Object::Visited {
for object in self.transposed[middle..right_end].iter_mut() {
*object = Object::Visited;
}

if right_object == Object::Sand {
let (x, _) = self.index_to_tuple_transposed(right_end);

self.fall_down(x, y);
}
}

if let (Object::Clay, Object::Clay) = (left_object, right_object) {
for object in self.transposed[left_end..right_end].iter_mut() {
*object = Object::Water;
}
return self.spread(x, y - 1);
}
}

fn unite(&mut self) {
let v: Vec<usize> = self
.objects
.iter()
.cloned()
.enumerate()
.filter_map(|(i, object)| {
if object == Object::Visited {
let index = self.tuple_to_index_transposed(self.index_to_tuple(i));

if self.transposed[index] == Object::Water {
None
} else {
Some(index)
}
} else {
None
}
})
.collect();

for i in v {
self.transposed[i] = Object::Visited;
}
}

fn count(&self) -> (u32, u32) {
self.transposed
.iter()
.cloned()
.fold((0, 0), |(w, v), object| {
if object == Object::Water {
(w + 1, v)
} else if object == Object::Visited {
(w, v + 1)
} else {
(w, v)
}
})
}
}

fn populate_initial_state(blueprints: Vec<Blueprints>) -> (Map, usize) {
let (x_min, y_min, x_max, y_max) = find_extremes(&blueprints);
let width = x_max - x_min + 3;
let depth = y_max - y_min + 1;
let spring = SPRING - x_min + 1;
let mut map = Map::new(depth, width);

for tuple in blueprints.into_iter().flat_map(move |blueprint| {
let (range, num, horizontal) = match blueprint {
Blueprints::Vertical { x, y } => (y, x, false),
Blueprints::Horizontal { x, y } => (x, y, true),
};

range.map(move |range| {
if horizontal {
(range - x_min + 1, num - y_min)
} else {
(num - x_min + 1, range - y_min)
}
})
}) {
let (t, o) = (
map.tuple_to_index_transposed(tuple),
map.tuple_to_index(tuple),
);
map.transposed[t] = Object::Clay;
map.objects[o] = Object::Clay;
}

(map, spring)
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-17-01.txt");

let blueprints = parse_input(path)?;

let (mut map, spring) = populate_initial_state(blueprints);

map.fall_down(spring, 0);

map.unite();

let (water, visited) = map.count();

println!("Part 1: {}", water + visited);
println!("Part 2: {}", water);

Ok(())
}

United States Atlanta, Georgia  No.2723904 

>>2723181
fun fact i made this screen shot

Brazil gopnik!Wo0bn/JfrQ Quirinopolis, Goias  No.2723916 +1 

>>2723904
Thanks, ron

Finland the finnish unkel Vaasa, Pohjanmaa  No.2723917 +1 

>>2723904
Thanks, ronald
Dice rollRolled 1d10. Result: 10.

United States Atlanta, Georgia  No.2723926 

>>2723916
>>2723917
was seriously my rich pleasure

Palestine, State of the palestinian vaginigger Khan Yunis, Gaza  No.2724103 

File: 1547491165746.txt (2.49 KB, input-18-01.txt)

day 18:

use std::collections::HashMap;
use std::fmt;
use std::fs::File;
use std::io::{BufRead, BufReader, Error as IoError};
use std::mem;
use std::path::Path;

const DIM: usize = 50;
const PART_ONE: usize = 10;
const PART_TWO: usize = 1_000_000_000;
const THRESHOLD: usize = 500;
type Map = [[Object; DIM]; DIM];

#[derive(Debug)]
enum Error {
Io(IoError),
Invalid(String),
}

impl From<IoError> for Error {
fn from(error: IoError) -> Self {
Error::Io(error)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::Invalid(s) => write!(f, "{}", s),
}
}
}

fn parse_input(path: &Path) -> Result<Map, Error> {
let mut map = [[Object::OpenGround; DIM]; DIM];

for (y, result) in BufReader::new(File::open(path)?).lines().enumerate() {
let row = result?;

for (x, object) in row.bytes().enumerate().take(DIM) {
match object {
b'|' => map[y][x] = Object::Trees,
b'#' => map[y][x] = Object::Lumberyard,
b'.' => (),
b => {
return Err(Error::Invalid(format!(
"invalid character: {}",
char::from(b)
)))
}
}
}
}

Ok(map)
}

#[derive(Copy, Clone)]
enum Object {
OpenGround,
Trees,
Lumberyard,
}

fn change(map: &Map, x: usize, y: usize) -> Object {
let mut trees = 0;
let mut lumber = 0;

let (x_min, x_max) = (
if x == 0 { 0 } else { x - 1 },
if x == DIM - 1 { DIM } else { x + 2 },
);
let (y_min, y_max) = (
if y == 0 { 0 } else { y - 1 },
if y == DIM - 1 { DIM } else { y + 2 },
);

for row in &map[y_min..y_max] {
for &object in &row[x_min..x_max] {
match object {
Object::Trees => trees += 1,
Object::Lumberyard => lumber += 1,
Object::OpenGround => (),
}
}
}

match map[y][x] {
Object::OpenGround if trees > 2 => Object::Trees,
Object::Trees if lumber > 2 => Object::Lumberyard,
Object::Lumberyard if lumber == 1 || trees == 0 => Object::OpenGround,
object => object,
}
}

fn advance_one_minute(previous: &Map, next: &mut Map) {
for (y, row) in next.iter_mut().enumerate() {
for (x, object) in row.iter_mut().enumerate() {
*object = change(previous, x, y);
}
}
}

fn count(map: &Map) -> usize {
let mut trees = 0;
let mut lumber = 0;

for row in map.iter() {
for &object in row.iter() {
match object {
Object::Trees => trees += 1,
Object::Lumberyard => lumber += 1,
Object::OpenGround => (),
}
}
}

trees * lumber
}

fn advance_time_naive(map: &mut Map) -> usize {
let mut next = &mut map.clone();
let mut previous = map;
for _ in 0..PART_ONE {
advance_one_minute(previous, next);
mem::swap(&mut previous, &mut next);
}

count(previous)
}

fn advance_time_oracle(map: &mut Map) -> usize {
let mut next = &mut map.clone();
let mut previous = map;
for _ in PART_ONE..THRESHOLD {
advance_one_minute(previous, next);

mem::swap(&mut previous, &mut next);
}

let mut times = HashMap::new();
let mut values = Vec::new();

for t in THRESHOLD..PART_TWO {
let value = count(previous);
values.push(value);

if let Some(tt) = times.insert(value, t) {
return values[tt + (PART_TWO - t) % (t - tt) - THRESHOLD];
}

advance_one_minute(previous, next);

mem::swap(&mut previous, &mut next);
}

count(previous)
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-18-01.txt");

let mut map = parse_input(path)?;
println!("Part 1: {:?}", advance_time_naive(&mut map));
println!("Part 2: {:?}", advance_time_oracle(&mut map));
Ok(())
}

Palestine, State of the palestinian house burner Khan Yunis, Gaza  No.2724967 

File: 1547527355896.txt (406 B, input-19-01.txt)

day 19:

use std::fmt;
use std::fs::File;
use std::io::{BufRead, BufReader, Error as IoError};
use std::num::ParseIntError;
use std::path::Path;
use std::str::FromStr;

const INSTRUCTION_COUNT: usize = 16;
const REGISTER_SIZE: usize = 6;

type Registers = [usize; REGISTER_SIZE];
type OpCode = fn(&mut Registers, usize, usize, usize);
type InstructionSet = [OpCode; INSTRUCTION_COUNT];

const INSTRUCTIONS: InstructionSet = [
|reg, a, b, c| reg[c] = reg[a] + reg[b],
|reg, a, b, c| reg[c] = reg[a] + b,
|reg, a, b, c| reg[c] = reg[a] * reg[b],
|reg, a, b, c| reg[c] = reg[a] * b,
|reg, a, b, c| reg[c] = reg[a] & reg[b],
|reg, a, b, c| reg[c] = reg[a] & b,
|reg, a, b, c| reg[c] = reg[a] | reg[b],
|reg, a, b, c| reg[c] = reg[a] | b,
|reg, a, _, c| reg[c] = reg[a],
|reg, a, _, c| reg[c] = a,
|reg, a, b, c| reg[c] = if a > reg[b] { 1 } else { 0 },
|reg, a, b, c| reg[c] = if b < reg[a] { 1 } else { 0 },
|reg, a, b, c| reg[c] = if reg[a] > reg[b] { 1 } else { 0 },
|reg, a, b, c| reg[c] = if a == reg[b] { 1 } else { 0 },
|reg, a, b, c| reg[c] = if b == reg[a] { 1 } else { 0 },
|reg, a, b, c| reg[c] = if reg[a] == reg[b] { 1 } else { 0 },
];

#[derive(Debug)]
enum Error {
Io(IoError),
ParseInt(ParseIntError),
Invalid(String),
}

impl From<IoError> for Error {
fn from(error: IoError) -> Self {
Error::Io(error)
}
}

impl From<ParseIntError> for Error {
fn from(error: ParseIntError) -> Self {
Error::ParseInt(error)
}
}

impl From<&str> for Error {
fn from(error: &str) -> Self {
Error::Invalid(error.into())
}
}

impl From<String> for Error {
fn from(error: String) -> Self {
Error::Invalid(error)
}
}

fn factor_sum(mut num: usize) -> usize {
let sqrt = (num as f64).sqrt() as usize + 1;
let mut res = 1;

for i in 2..sqrt {
let mut sum = 1;
let mut term = 1;

while num % i == 0 {
num /= i;
term *= i;
sum += term;
}

res *= sum
}

if num > 2 {
res *= 1 + num;
}

res
}

#[derive(Debug)]
struct Device {
registers: Registers,
instruction_pointer: usize,
}

impl Device {
fn reset(&mut self) {
self.registers[0] = 1;
for r in self.registers[1..].iter_mut() {
*r = 0;
}
}

fn execute(&mut self, instructions: &[Instruction]) -> usize {
while let Some(instruction) = instructions.get(self.registers[self.instruction_pointer]) {
if instruction.opcode == 15 {
return factor_sum(if instruction.a == instruction.b {
self.registers[instruction.c]
} else if instruction.a == instruction.c {
self.registers[instruction.b]
} else {
self.registers[instruction.a]
});
}

INSTRUCTIONS[instruction.opcode](
&mut self.registers,
instruction.a,
instruction.b,
instruction.c,
);

self.registers[self.instruction_pointer] += 1;
}

self.registers[0]
}
}

impl FromStr for Device {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
if s.len() < 5 || &s[0..4] != "#ip " {
Err(Error::from("missing instruction pointer"))
} else {
s[4..]
.parse()
.map_err(Error::from)
.and_then(|instruction_pointer| {
if instruction_pointer < 6 {
Ok(Device {
registers: [0; REGISTER_SIZE],
instruction_pointer,
})
} else {
Err(Error::from("instruction pointer out of bounds"))
}
})
}
}
}

#[derive(Debug)]
struct Instruction {
opcode: usize,
a: usize,
b: usize,
c: usize,
}

impl FromStr for Instruction {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
let mut split = s.split_whitespace();

let (opcode, a, b, c) = match (split.next(), split.next(), split.next(), split.next()) {
(Some(opcode), Some(a), Some(b), Some(c)) => {
(opcode, a.parse()?, b.parse()?, c.parse()?)
}
_ => return Err(Error::from("invalid instruction syntax")),
};

let opcode = match opcode {
"addr" => 0,
"addi" => 1,
"mulr" => 2,
"muli" => 3,
"banr" => 4,
"bani" => 5,
"borr" => 6,
"bori" => 7,
"setr" => 8,
"seti" => 9,
"gtir" => 10,
"gtri" => 11,
"gtrr" => 12,
"eqir" => 13,
"eqri" => 14,
"eqrr" => 15,
opcode => return Err(Error::Invalid(format!("invalid opcode {}", opcode))),
};

Ok(Instruction { opcode, a, b, c })
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::ParseInt(e) => fmt::Display::fmt(e, f),
Error::Invalid(s) => write!(f, "{}", s),
}
}
}

fn parse_input(path: &Path) -> Result<(Device, Vec<Instruction>), Error> {
let mut lines = BufReader::new(File::open(path)?).lines();

let device = lines
.next()
.ok_or_else(|| Error::from("unexpected EOF"))??
.parse()?;

let instructions = lines
.map(|result| result.map_err(Error::from).and_then(|s| s.parse()))
.collect::<Result<_, _>>()?;

Ok((device, instructions))
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-19-01.txt");

let (mut device, instructions) = parse_input(path)?;

println!("Part 1: {}", device.execute(&instructions));

device.reset();

println!("Part 2: {}", device.execute(&instructions));

Ok(())
}

Turkey the turkish nerd Istanbul, Istanbul  No.2725267 

time to rebase and rewrite 27 commits so they are prettier

epic engineering hours

Palestine, State of the palestinian pizza boy Khan Yunis, Gaza  No.2725532 

>>2725267
portfolio polisher

Palestine, State of the palestinian 8channer Khan Yunis, Gaza  No.2726764 

File: 1547629937731.txt (13.95 KB, input-20-01.txt)

day 20:

use std::collections::HashMap;
use std::fmt;
use std::fs::File;
use std::io::{Error as IoError, Read};
use std::path::Path;

#[macro_use]
extern crate bitflags;

const THRESHOLD: u16 = 999;

#[derive(Debug)]
enum Error {
Io(IoError),
Invalid(String),
}

impl From<IoError> for Error {
fn from(error: IoError) -> Self {
Error::Io(error)
}
}

impl From<&str> for Error {
fn from(error: &str) -> Self {
Error::Invalid(error.into())
}
}

impl From<String> for Error {
fn from(error: String) -> Self {
Error::Invalid(error)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::Invalid(s) => write!(f, "{}", s),
}
}
}

bitflags! {
struct Doors: u8 {
const NONE = 0b0000;
const NORTH = 0b0001;
const WEST = 0b0010;
const EAST = 0b0100;
const SOUTH = 0b1000;
}
}

#[derive(Debug)]
struct Map {
doors: Vec<Doors>,
stride: usize,
start: usize,
}

fn populate(input: &[u8]) -> Result<Map, Error> {
let mut map = HashMap::new();
let mut locations = vec![];

let (_, x_min, y_min, x_max, y_max) = input.iter().cloned().try_fold(
((0, 0), 0, 0, 0, 0),
|(location, x_min, y_min, x_max, y_max), b| {
let (x, y) = {
match b {
b'N' => {
map.entry(location)
.and_modify(|o| *o |= Doors::NORTH)
.or_insert(Doors::NORTH);
let location = (location.0, location.1 - 1);
map.entry(location)
.and_modify(|o| *o |= Doors::SOUTH)
.or_insert(Doors::SOUTH);
location
}
b'W' => {
map.entry(location)
.and_modify(|o| *o |= Doors::WEST)
.or_insert(Doors::WEST);
let location = (location.0 - 1, location.1);
map.entry(location)
.and_modify(|o| *o |= Doors::EAST)
.or_insert(Doors::EAST);
location
}
b'E' => {
map.entry(location)
.and_modify(|o| *o |= Doors::EAST)
.or_insert(Doors::EAST);
let location = (location.0 + 1, location.1);
map.entry(location)
.and_modify(|o| *o |= Doors::WEST)
.or_insert(Doors::WEST);
location
}
b'S' => {
map.entry(location)
.and_modify(|o| *o |= Doors::SOUTH)
.or_insert(Doors::SOUTH);
let location = (location.0, location.1 + 1);
map.entry(location)
.and_modify(|o| *o |= Doors::NORTH)
.or_insert(Doors::NORTH);
location
}
b'(' => {
locations.push(location);
return Ok((location, x_min, y_min, x_max, y_max));
}
b')' => {
return match locations.pop() {
Some(location) => Ok((location, x_min, y_min, x_max, y_max)),
None => Err("no open parentheses to close".into()),
}
}
b'|' => {
return match locations.last() {
Some(&location) => Ok((location, x_min, y_min, x_max, y_max)),
None => Ok(((0, 0), x_min, y_min, x_max, y_max)),
}
}
invalid => {
return Err(Error::Invalid(format!(
"invalid character: {}",
invalid as char
)))
}
}
};

Ok((
(x, y),
if x < x_min { x } else { x_min },
if y < y_min { y } else { y_min },
if x > x_max { x } else { x_max },
if y > y_max { y } else { y_max },
))
},
)?;

if !locations.is_empty() {
return Err("unclosed parentheses".into());
}

let x_size = x_max - x_min + 1;
let y_size = y_max - y_min + 1;
let stride = x_size as usize;
let start = (0 - y_min * x_size - x_min) as usize;
let mut doors = vec![Doors::NONE; stride * y_size as usize];

for ((x, y), door) in map.drain() {
doors[((y - y_min) * x_size + x - x_min) as usize] = door;
}

Ok(Map {
doors,
stride,
start,
})
}

fn parse_input(path: &Path) -> Result<Map, Error> {
let mut buffer = Vec::new();
File::open(path)?.read_to_end(&mut buffer)?;

let data = match (
buffer.first(),
buffer.iter().enumerate().rev().find(|(_, &b)| b != b'\n'),
) {
(Some(b'^'), Some((len, b'$'))) => &buffer[1..len],
_ => return Err("invalid regex syntax".into()),
};

populate(data)
}

fn calculate_distances(map: &Map, distances: &mut [u16], position: usize, distance: u16) {
distances[position] = distance;

let doors = map.doors[position];
let new_dist = distance + 1;

if doors.contains(Doors::NORTH) && distances[position - map.stride] > new_dist {
calculate_distances(map, distances, position - map.stride, new_dist);
}
if doors.contains(Doors::WEST) && distances[position - 1] > new_dist {
calculate_distances(map, distances, position - 1, new_dist);
}
if doors.contains(Doors::EAST) && distances[position + 1] > new_dist {
calculate_distances(map, distances, position + 1, new_dist);
}
if doors.contains(Doors::SOUTH) && distances[position + map.stride] > new_dist {
calculate_distances(map, distances, position + map.stride, new_dist);
}
}

fn longest_shortest_path(map: &Map) -> (u16, usize) {
let mut distances = vec![u16::max_value(); map.doors.len()];

calculate_distances(&map, &mut distances, map.start, 0);

(
distances.iter().cloned().max().unwrap(),
distances.iter().cloned().filter(|&x| x > THRESHOLD).count(),
)
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-20-01.txt");

let map = parse_input(path)?;

let (longest, count) = longest_shortest_path(&map);

println!("Part 1: {}", longest);
println!("Part 2: {}", count);

Ok(())
}

Germany escapism pro!snw79wAK4o Bremen, Bremen  No.2726781 

File: 1547633156749.jpg (214.89 KB, 500x700, 1541028991141.jpg) ImgOps Exif Google

helo where are the python :–DDDDDDD
Dice rollRolled fortune rate yolo. Result: False.

Palestine, State of the palestinian patrik fridén Khan Yunis, Gaza  No.2727988 

File: 1547687605602.txt (389 B, input-21-01.txt)

day 21:

use std::collections::HashSet;
use std::fmt;
use std::fs::File;
use std::io::{BufRead, BufReader, Error as IoError};
use std::num::ParseIntError;
use std::path::Path;
use std::str::FromStr;

const SMALL_AND: i32 = (1 << 8) - 1;
const BIG_AND: i32 = (1 << 24) - 1;
const SHIFT: i32 = 8;
const OR: i32 = 1 << 16;

#[derive(Debug)]
enum Error {
Io(IoError),
ParseInt(ParseIntError),
Invalid(String),
}

impl From<IoError> for Error {
fn from(error: IoError) -> Self {
Error::Io(error)
}
}

impl From<ParseIntError> for Error {
fn from(error: ParseIntError) -> Self {
Error::ParseInt(error)
}
}

impl From<&str> for Error {
fn from(error: &str) -> Self {
Error::Invalid(error.into())
}
}


impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::ParseInt(e) => fmt::Display::fmt(e, f),
Error::Invalid(s) => write!(f, "{}", s),
}
}
}

#[derive(Debug)]
struct Device;

impl FromStr for Device {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
if s.len() < 5 || &s[0..4] != "#ip " {
Err(Error::from("missing instruction pointer"))
} else {
s[4..]
.parse::<u8>()
.map_err(Error::from)
.and_then(|instruction_pointer| {
if instruction_pointer < 6 {
Ok(Device)
} else {
Err(Error::from("instruction pointer out of bounds"))
}
})
}
}
}

#[derive(Debug)]
struct Instruction {
opcode: i32,
a: i32,
b: i32,
c: i32,
}

impl FromStr for Instruction {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
let mut split = s.split_whitespace();

let (opcode, a, b, c) = match (split.next(), split.next(), split.next(), split.next()) {
(Some(opcode), Some(a), Some(b), Some(c)) => {
(opcode, a.parse()?, b.parse()?, c.parse()?)
}
_ => return Err(Error::from("invalid instruction syntax")),
};

let opcode = match opcode {
"addr" => 0,
"addi" => 1,
"mulr" => 2,
"muli" => 3,
"banr" => 4,
"bani" => 5,
"borr" => 6,
"bori" => 7,
"setr" => 8,
"seti" => 9,
"gtir" => 10,
"gtri" => 11,
"gtrr" => 12,
"eqir" => 13,
"eqri" => 14,
"eqrr" => 15,
opcode => return Err(Error::Invalid(format!("invalid opcode {}", opcode))),
};

Ok(Instruction { opcode, a, b, c })
}
}

fn parse_input(path: &Path) -> Result<(i32, i32), Error> {
let mut lines = BufReader::new(File::open(path)?).lines();

let _ = lines
.next()
.ok_or_else(|| Error::from("unexpected EOF"))??
.parse::<Device>()?;

let instructions = lines
.map(|result| result.map_err(Error::from).and_then(|s| s.parse()))
.collect::<Result<Vec<Instruction>, _>>()?;

Ok((instructions[7].a, instructions[11].b))
}

fn compute(mut ans: i32, mult: i32, mut add: i32) -> i32 {
ans += add & SMALL_AND;
ans *= mult;
ans &= BIG_AND;
add >>= SHIFT;
ans += add & SMALL_AND;
ans *= mult;
ans &= BIG_AND;
add >>= SHIFT;
ans += add & SMALL_AND;
ans *= mult;
ans & BIG_AND
}

fn fast_execute(seed: i32, mult: i32) -> (i32, i32) {
let mut add = 0 | OR;
let mut add_set = HashSet::new();
let mut ans_set = HashSet::new();

add_set.insert(add);
let first = compute(seed, mult, add);
let mut last = first;
add = first | OR;

while add_set.insert(add) {
let ans = compute(seed, mult, add);
add = ans | OR;
if ans_set.insert(ans) {
last = ans;
}
}

(first, last)
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-21-01.txt");

let (seed, mult) = parse_input(path)?;

let (first, last) = fast_execute(seed, mult);

println!("Part 1: {}", first);
println!("Part 2: {}", last);

Ok(())
}

Palestine, State of the palestinian horse rapist Khan Yunis, Gaza  No.2728475 

day 22:

input:
depth: 8787
target: 10,725


const DEPTH: u32 = 8787;
const TARGET_X: usize = 10;
const TARGET_Y: usize = 725;
const GEO_INDEX_X: u32 = 16807;
const GEO_INDEX_Y: u32 = 48271;
const EROSION: u32 = 20183;
const MOD: u32 = 3;
const MAP_Y: usize = TARGET_Y + 50;
const MAP_X: usize = TARGET_X + 20;
const SWITCH_TIME: u16 = 7;
const MOVE_TIME: u16 = 1;

#[derive(Copy, Clone)]
enum Terrain {
Rocky,
Wet,
Narrow,
}

#[derive(Copy, Clone)]
enum Tool {
Torch,
ClimbingGear,
Neither,
}

type Map = [[Terrain; MAP_X]; MAP_Y];
type Times = [[(u16, u16); MAP_X]; MAP_Y];

fn map() -> Map {
let mut map = [[Terrain::Rocky; MAP_X]; MAP_Y];

let mut row = [0u32; MAP_X];
for (x, cell) in row.iter_mut().enumerate() {
let erosion = (x as u32 * GEO_INDEX_X + DEPTH) % EROSION;
*cell = erosion;
map[0][x] = match erosion % MOD {
1 => Terrain::Wet,
2 => Terrain::Narrow,
_ => Terrain::Rocky,
};
}

let mut column = [0u32; MAP_Y];
for (y, cell) in column.iter_mut().enumerate() {
let erosion = (y as u32 * GEO_INDEX_Y + DEPTH) % EROSION;
*cell = erosion;
map[y][0] = match erosion % MOD {
1 => Terrain::Wet,
2 => Terrain::Narrow,
_ => Terrain::Rocky,
};
}

for (y, &first) in column.iter().enumerate().skip(1) {
let mut prev = first;

for (x, cell) in row.iter_mut().enumerate().skip(1) {
let erosion = (prev * *cell + DEPTH) % EROSION;
*cell = erosion;
map[y][x] = match erosion % MOD {
1 => Terrain::Wet,
2 => Terrain::Narrow,
_ => Terrain::Rocky,
};

prev = erosion;
}
}

map
}

fn sum(map: &Map) -> u32 {
map.iter()
.take(TARGET_Y + 1)
.flat_map(|row| {
row.iter()
.cloned()
.take(TARGET_X + 1)
.map(|terrain| terrain as u32)
})
.sum()
}

fn move_to(
map: &Map,
times: &mut Times,
x: usize,
y: usize,
time: u16,
tool: Tool,
terrain: Terrain,
) {
let (duration, tool) = match (terrain, map[y][x], tool) {
(Terrain::Rocky, Terrain::Wet, Tool::Torch)
| (Terrain::Wet, Terrain::Rocky, Tool::Neither) => (SWITCH_TIME, Tool::ClimbingGear),
(Terrain::Wet, Terrain::Narrow, Tool::ClimbingGear)
| (Terrain::Narrow, Terrain::Wet, Tool::Torch) => (SWITCH_TIME, Tool::Neither),
(Terrain::Rocky, Terrain::Narrow, Tool::ClimbingGear)
| (Terrain::Narrow, Terrain::Rocky, Tool::Neither) => (SWITCH_TIME, Tool::Torch),
_ => (0, tool),
};

calculate_times(map, times, x, y, time + duration + MOVE_TIME, tool);
}

fn calculate_times(map: &Map, times: &mut Times, x: usize, y: usize, time: u16, tool: Tool) {
let terrain = map[y][x];
let old_time = match (terrain, tool) {
(Terrain::Rocky, Tool::Torch)
| (Terrain::Wet, Tool::ClimbingGear)
| (Terrain::Narrow, Tool::Torch) => &mut times[y][x].0,
_ => &mut times[y][x].1,
};

if time >= *old_time || time > (TARGET_X + TARGET_Y) as u16 * 2 {
return;
}

*old_time = time;

if y != 0 {
move_to(map, times, x, y - 1, time, tool, terrain);
}
if x != 0 {
move_to(map, times, x - 1, y, time, tool, terrain);
}
if y != MAP_Y - 1 {
move_to(map, times, x, y + 1, time, tool, terrain);
}
if x != MAP_X - 1 {
move_to(map, times, x + 1, y, time, tool, terrain);
}
}

fn fastest_time(map: &Map) -> u16 {
let mut times: Times = [[(u16::max_value(), u16::max_value()); MAP_X]; MAP_Y];
let tool = Tool::Torch;

calculate_times(map, &mut times, 0, 0, 0, tool);

let times = times[TARGET_Y][TARGET_X];

if times.0 > times.1 + SWITCH_TIME {
times.1 + SWITCH_TIME
} else {
times.0
}
}

fn main() {
let mut map = map();
map[TARGET_Y][TARGET_X] = Terrain::Rocky;
println!("Part 1: {}", sum(&map));
println!("Part 2: {}", fastest_time(&map));
}

Palestine, State of the palestinian scaly Khan Yunis, Gaza  No.2730228 

File: 1547834580893.txt (44.04 KB, input-23-01.txt)

day 23:

use std::fmt;
use std::fs::File;
use std::io::{BufRead, BufReader, Error as IoError};
use std::num::ParseIntError;
use std::path::Path;
use std::str::FromStr;

#[derive(Debug)]
enum Error {
Io(IoError),
ParseInt(ParseIntError),
Invalid(String),
}

impl From<IoError> for Error {
fn from(error: IoError) -> Self {
Error::Io(error)
}
}

impl From<ParseIntError> for Error {
fn from(error: ParseIntError) -> Self {
Error::ParseInt(error)
}
}

impl From<&str> for Error {
fn from(error: &str) -> Self {
Error::Invalid(error.into())
}
}

impl From<String> for Error {
fn from(error: String) -> Self {
Error::Invalid(error)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::ParseInt(e) => fmt::Display::fmt(e, f),
Error::Invalid(s) => write!(f, "invalid input: {}", s),
}
}
}

#[derive(Debug)]
struct Coordinate {
x: i32,
y: i32,
z: i32,
}

impl Coordinate {
fn distance(&self, other: &Self) -> i32 {
(self.x - other.x).abs() + (self.y - other.y).abs() + (self.z - other.z).abs()
}
}

struct Octant {
x_min: i32,
x_max: i32,
y_min: i32,
y_max: i32,
z_min: i32,
z_max: i32,
}

type Octets = [Octant; 8];

impl Octant {
fn octets(&self) -> Octets {
let Octant {
x_min,
x_max,
y_min,
y_max,
z_min,
z_max,
} = *self;
let x_mid = (x_max + x_min) / 2;
let y_mid = (y_max + y_min) / 2;
let z_mid = (z_max + z_min) / 2;

[
Octant {
x_min,
x_max: x_mid,
y_min,
y_max: y_mid,
z_min,
z_max: z_mid,
},
Octant {
x_min: x_mid,
x_max,
y_min,
y_max: y_mid,
z_min,
z_max: z_mid,
},
Octant {
x_min,
x_max: x_mid,
y_min: y_mid,
y_max,
z_min,
z_max: z_mid,
},
Octant {
x_min: x_mid,
x_max,
y_min: y_mid,
y_max,
z_min,
z_max: z_mid,
},
Octant {
x_min,
x_max: x_mid,
y_min,
y_max: y_mid,
z_min: z_mid,
z_max,
},
Octant {
x_min: x_mid,
x_max,
y_min,
y_max: y_mid,
z_min: z_mid,
z_max,
},
Octant {
x_min,
x_max: x_mid,
y_min: y_mid,
y_max,
z_min: z_mid,
z_max,
},
Octant {
x_min: x_mid,
x_max,
y_min: y_mid,
y_max,
z_min: z_mid,
z_max,
},
]
}

fn coverage(&self, nanobot: &NanoBot) -> bool {
if !nanobot.in_radius(&Coordinate {
x: if nanobot.coordinate.x < self.x_min {
self.x_min
} else if nanobot.coordinate.x > self.x_max {
self.x_max
} else {
nanobot.coordinate.x
},
y: if nanobot.coordinate.y < self.y_min {
self.y_min
} else if nanobot.coordinate.y > self.y_max {
self.y_max
} else {
nanobot.coordinate.y
},
z: if nanobot.coordinate.z < self.z_min {
self.z_min
} else if nanobot.coordinate.z > self.z_max {
self.z_max
} else {
nanobot.coordinate.z
},
}) {
false
} else {
true
}
}

fn coverage_all(&self, nanobots: &[NanoBot]) -> i32 {
nanobots
.iter()
.filter(|&nanobot| self.coverage(nanobot))
.count() as i32
}

fn size(&self) -> i32 {
(self.x_max - self.x_min)
.saturating_mul((self.y_max - self.y_min).saturating_mul(self.y_max - self.y_min))
}

fn expand(&mut self, add: i32) {
self.x_min -= add;
self.x_max += add;
self.y_min -= add;
self.y_max += add;
self.z_min -= add;
self.z_max += add;
}
}

struct NanoBot {
coordinate: Coordinate,
radius: i32,
}

impl NanoBot {
fn in_radius(&self, other: &Coordinate) -> bool {
self.radius >= self.coordinate.distance(other)
}
}

impl FromStr for NanoBot {
type Err = Error;

fn from_str(string: &str) -> Result<Self, Self::Err> {
match string.get(0..5) {
Some("pos=<") => (),
Some(invalid) => return Err(invalid.into()),
None => return Err("unexpected EOL".into()),
}

let mut split = string[5..].split(',');

let x = split
.next()
.ok_or_else(|| "x coordinate missing".into())
.and_then(|s| s.parse().map_err(Error::from))?;

let y = split
.next()
.ok_or_else(|| "y coordinate missing".into())
.and_then(|s| s.parse().map_err(Error::from))?;

let z = split
.next()
.ok_or_else(|| "z coordinate missing".into())
.and_then(|s| {
match s.bytes().last() {
Some(b'>') => (),
Some(s) => return Err(format!("{}", s as char).into()),
None => return Err("z coordinate missing".into()),
}

s[0..s.len() - 1].parse().map_err(Error::from)
})?;

let coordinate = Coordinate { x, y, z };

let radius = split
.next()
.ok_or_else(|| "radius missing".into())
.and_then(|s| {
match s.get(0..3) {
Some(" r=") => (),
Some(s) => return Err(s.into()),
None => return Err("radius missing".into()),
}

s[3..].parse().map_err(Error::from)
})?;

match split.next() {
None => Ok(NanoBot { coordinate, radius }),
Some(junk) => Err(junk.into()),
}
}
}

fn parse_input(path: &Path) -> Result<Vec<NanoBot>, Error> {
let nanobots = BufReader::new(File::open(path)?)
.lines()
.map(|line| line.map_err(Error::from).and_then(|s| s.parse()))
.collect::<Result<Vec<NanoBot>, Error>>()?;

if !nanobots.is_empty() {
Ok(nanobots)
} else {
Err("empty input".into())
}
}

fn largest_radius(nanobots: &[NanoBot]) -> &NanoBot {
nanobots
.iter()
.max_by_key(|NanoBot { radius, .. }| radius)
.unwrap()
}

fn count_in_radius(nanobots: &[NanoBot], nanobot: &NanoBot) -> usize {
nanobots
.iter()
.filter(|other| nanobot.in_radius(&other.coordinate))
.count()
}

fn enclosing_volume(nanobots: &[NanoBot]) -> Octant {
nanobots.iter().fold(
Octant {
x_min: i32::max_value(),
x_max: i32::min_value(),
y_min: i32::max_value(),
y_max: i32::min_value(),
z_min: i32::max_value(),
z_max: i32::min_value(),
},
|Octant {
x_min,
x_max,
y_min,
y_max,
z_min,
z_max,
},
&NanoBot {
coordinate: Coordinate { x, y, z },
..
}| {
Octant {
x_min: if x < x_min { x } else { x_min },
x_max: if x >= x_max { x + 1 } else { x_max },
y_min: if y < y_min { y } else { y_min },
y_max: if y >= y_max { y + 1 } else { y_max },
z_min: if z < z_min { z } else { z_min },
z_max: if z >= z_max { z + 1 } else { z_max },
}
},
)
}

fn distance(nanobots: &[NanoBot], coordinate: &Coordinate, max_in_range: i32) -> Option<i32> {
let in_range = nanobots
.iter()
.filter(|nanobot| nanobot.in_radius(coordinate))
.count() as i32;
if in_range == max_in_range {
Some(coordinate.x + coordinate.y + coordinate.z)
} else {
None
}
}

fn search(nanobots: &[NanoBot], octant: &Octant, in_range: i32) -> Option<i32> {
match octant.size() {
0 => None,
1 => distance(
nanobots,
&Coordinate {
x: octant.x_min,
y: octant.y_min,
z: octant.z_min,
},
in_range,
),
_ => {
if octant.coverage_all(nanobots) < in_range {
None
} else {
octant
.octets()
.iter()
.filter_map(|octant| search(nanobots, octant, in_range))
.min()
}
}
}
}

fn init_search(nanobots: &[NanoBot]) -> (i32, i32) {
let max_in_range = nanobots.len() as i32 + 1;
let mut octant = enclosing_volume(&nanobots);
octant.expand(largest_radius(nanobots).radius);
for in_range in (0..max_in_range).rev() {
if let Some(distance) = search(nanobots, &octant, in_range) {
return (in_range, distance);
}
}

(0, 0)
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-23-01.txt");

let nanobots = parse_input(path)?;

println!(
"Part 1: {}",
count_in_radius(&nanobots, largest_radius(&nanobots))
);

let (in_range, distance) = init_search(&nanobots);
println!("Part 2: {} ({} in range)", distance, in_range);

Ok(())
}

Palestine, State of the palestinian blöndal Khan Yunis, Gaza  No.2732310 

File: 1547971690072.txt (2.41 KB, input-24-01.txt)

day 24:

use std::fmt;
use std::fs::File;
use std::io::{BufRead, BufReader, Error as IoError};
use std::num::ParseIntError;
use std::ops::{Index, IndexMut};
use std::path::Path;
use std::str::FromStr;

use lazy_static::lazy_static;
use regex::Regex;

#[derive(Debug)]
enum Error {
Io(IoError),
ParseInt(ParseIntError),
Invalid(String),
}

impl From<IoError> for Error {
fn from(error: IoError) -> Self {
Error::Io(error)
}
}

impl From<ParseIntError> for Error {
fn from(error: ParseIntError) -> Self {
Error::ParseInt(error)
}
}

impl From<&str> for Error {
fn from(error: &str) -> Self {
Error::Invalid(error.into())
}
}

impl From<String> for Error {
fn from(error: String) -> Self {
Error::Invalid(error)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::ParseInt(e) => fmt::Display::fmt(e, f),
Error::Invalid(s) => write!(f, "{}", s),
}
}
}

#[derive(Copy, Clone, Debug)]
enum Effect {
Slashing,
Bludgeoning,
Fire,
Cold,
Radiation,
}

const EFFECTS: usize = 5;

impl FromStr for Effect {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(match s {
"slashing" => Effect::Slashing,
"bludgeoning" => Effect::Bludgeoning,
"fire" => Effect::Fire,
"cold" => Effect::Cold,
"radiation" => Effect::Radiation,
s => return Err(format!("invalid effect: {}", s).into()),
})
}
}

#[derive(Copy, Clone, Debug)]
enum Modifier {
Immune,
Normal,
Weak,
}

impl FromStr for Modifier {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(match s {
"weak" => Modifier::Weak,
"immune" => Modifier::Immune,
s => return Err(format!("invalid modifier: {}", s).into()),
})
}
}

#[derive(Debug, Clone)]
struct Modifiers([Modifier; EFFECTS]);

impl Modifiers {
fn new() -> Self {
Modifiers([Modifier::Normal; EFFECTS])
}
}

impl Index<Effect> for Modifiers {
type Output = Modifier;

fn index(&self, effect: Effect) -> &Self::Output {
&self.0[effect as usize]
}
}

impl IndexMut<Effect> for Modifiers {
fn index_mut(&mut self, effect: Effect) -> &mut Self::Output {
&mut self.0[effect as usize]
}
}

#[derive(Debug, Clone)]
struct Group {
units: u32,
hit_points: u32,
modifiers: Modifiers,
effect: Effect,
damage: u32,
initiative: u32,
order: usize,
}

impl Group {
fn effective_power(&self) -> u32 {
self.units * self.damage
}

fn potential_damage_to(&self, enemy: &Self) -> u32 {
self.effective_power() * enemy.modifiers[self.effect] as u32
}

fn get_hit_with(&mut self, damage: u32) {
self.units = self.units.saturating_sub(damage / self.hit_points);
}

fn is_alive(&self) -> bool {
self.units != 0
}
}

impl FromStr for Group {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
lazy_static! {
static ref RE: Regex = Regex::new(
r"(?x)
(?P<units>\d+)\sunits\s
each\swith\s(?P<hp>\d+)\shit\spoints\s
(?:\((?P<modifier1>\w+)\sto\s
(?P<modifiedEffect1>[^);]+)(?:;
\s(?P<modifier2>\w+)\sto\s
(?P<modifiedEffect2>[^)]+))?\)\s)?
with\san\sattack\sthat\sdoes\s
(?P<damage>\d+)\s(?P<effect>\w+)\sdamage\s
at\sinitiative\s(?P<initiative>\d+)
",
)
.unwrap();
}

let caps = match RE.captures(s) {
Some(caps) => caps,
None => return Err(format!("invalid group pattern: {}", s).into()),
};

let units = caps["units"].parse()?;
let hit_points = caps["hp"].parse()?;
let effect = caps["effect"].parse()?;
let damage = caps["damage"].parse()?;
let initiative = caps["initiative"].parse()?;
let mut modifiers = Modifiers::new();

if let Some(effects) = caps.name("modifiedEffect1") {
let modifier = caps["modifier1"].parse()?;
for effect in effects.as_str().split(", ") {
modifiers[effect.parse::<Effect>()?] = modifier;
}
}
if let Some(effects) = caps.name("modifiedEffect2") {
let modifier = caps["modifier2"].parse()?;
for effect in effects.as_str().split(", ") {
modifiers[effect.parse::<Effect>()?] = modifier;
}
}

Ok(Group {
units,
hit_points,
modifiers,
effect,
damage,
initiative,
order: 0,
})
}
}
#[derive(Debug, Clone)]
struct Turn {
index: usize,
attacking: Option<usize>,
}

#[derive(Debug, Clone)]
struct Pick {
index: usize,
order: (u32, u32),
}

#[derive(Debug, Clone)]
struct Battle {
groups: Vec<Group>,
targeted: Vec<bool>,
separator: usize,
turn_order: Vec<Turn>,
immune_system_picking_order: Vec<Pick>,
infection_picking_order: Vec<Pick>,
}

#[derive(Debug)]
enum EndResult {
Victory,
Defeat,
Deadlock,
}

fn picking_order(groups: &[Group], picking_order: &mut Vec<Pick>, separator: usize) {
picking_order.clear();
for (index, group) in groups.iter().enumerate() {
if group.is_alive() {
let order = (
u32::max_value() - group.effective_power(),
u32::max_value() - group.initiative,
);
picking_order.push(Pick {
index: index + separator,
order,
});
}
}
picking_order.sort_unstable_by_key(|&Pick { order, .. }| order);
}

fn attack_order(
picking_order: &[Pick],
enemy_picking_order: &[Pick],
groups: &[Group],
turn_order: &mut [Turn],
targeted: &mut [bool],
) {
for group in picking_order
.iter()
.map(|&Pick { index, .. }| &groups[index])
{
turn_order[group.order].attacking = if let Some((_, _, _, index)) = enemy_picking_order
.iter()
.filter_map(|&Pick { index, .. }| {
if targeted[index] {
None
} else {
let enemy = &groups[index];
let potential_damage = group.potential_damage_to(enemy);
if potential_damage == 0 {
None
} else {
Some((
group.potential_damage_to(enemy),
enemy.effective_power(),
enemy.initiative,
index,
))
}
}
})
.max()
{
targeted[index] = true;
Some(index)
} else {
None
}
}
}

impl Battle {
fn pick_targets(&mut self) {
let immune_system_picking_order = &mut self.immune_system_picking_order;
let infection_picking_order = &mut self.infection_picking_order;
let separator = self.separator;
let groups: &[Group] = &self.groups;
let (immune_system, infection) = groups.split_at(separator);
let targeted: &mut [bool] = &mut self.targeted;
for targeted in targeted.iter_mut() {
*targeted = false;
}

picking_order(immune_system, immune_system_picking_order, 0);
picking_order(infection, infection_picking_order, separator);

let turn_order: &mut [Turn] = &mut self.turn_order;

attack_order(
immune_system_picking_order,
infection_picking_order,
groups,
turn_order,
targeted,
);
attack_order(
infection_picking_order,
immune_system_picking_order,
groups,
turn_order,
targeted,
);
}

fn simulate_round(&mut self) {
for turn in &mut self.turn_order {
if let Some(index) = turn.attacking {
let group = &self.groups[turn.index];
let enemy = &self.groups[index];
if group.is_alive() {
let damage = group.potential_damage_to(enemy);
self.groups[index].get_hit_with(damage);
}
turn.attacking = None;
}
}
}

fn remaining_units(&self) -> u32 {
self.groups.iter().map(|group| group.units).sum()
}

fn simulate(&mut self) -> u32 {
loop {
self.pick_targets();
if self.immune_system_picking_order.is_empty()
|| self.infection_picking_order.is_empty()
{
return self.remaining_units();
}
self.simulate_round();
}
}

fn boost_immune_system(&mut self, boost: u32) {
for group in &mut self.groups[0..self.separator] {
group.damage += boost;
}
}

fn simulate_with_boost(&mut self, boost: u32) -> (u32, EndResult) {
self.boost_immune_system(boost);
let mut remaining_units = u32::max_value();

loop {
self.pick_targets();
match (
self.immune_system_picking_order.is_empty(),
self.infection_picking_order.is_empty(),
self.remaining_units(),
) {
(false, false, result) => {
if result == remaining_units {
return (result, EndResult::Deadlock);
} else {
remaining_units = result;
}
}
(true, false, result) => return (result, EndResult::Defeat),
(false, true, result) => return (result, EndResult::Victory),
_ => panic!(),
}
self.simulate_round();
}
}

fn find_smallest_boost(&self) -> (u32, u32) {
for boost in 0.. {
if let (remaining_units, EndResult::Victory) = self.clone().simulate_with_boost(boost) {
return (remaining_units, boost);
}
}
panic!();
}
}

fn parse_input(path: &Path) -> Result<Battle, Error> {
let mut lines = BufReader::new(File::open(path)?).lines();
let mut groups = vec![];
let mut initiative = vec![];

match lines
.next()
.ok_or_else(|| "unexpected EOF".into())
.and_then(|result| result.map_err(Error::from))
{
Ok(s) => match s.as_ref() {
"Immune System:" => (),
_ => return Err(format!(r#"expected "Immune System:", got: {}"#, s).into()),
},
Err(e) => return Err(e),
}

for (i, line) in (&mut lines).enumerate() {
let s = line?;
if s.is_empty() {
break;
} else {
let group: Group = s.parse()?;
initiative.push((group.initiative, i));
groups.push(group);
}
}

let separator = groups.len();

match lines
.next()
.ok_or_else(|| "unexpected EOF".into())
.and_then(|result| result.map_err(Error::from))
{
Ok(s) => match s.as_ref() {
"Infection:" => (),
_ => return Err(format!(r#"expected "Infection:", got: {}"#, s).into()),
},
Err(e) => return Err(e),
}

for (i, line) in (separator..).zip(lines) {
let group: Group = line?.parse()?;
initiative.push((group.initiative, i));
groups.push(group);
}

initiative.sort_unstable_by_key(|&(initiative, _)| u32::max_value() - initiative);
let mut turn_order = vec![];

for (i, (_, index)) in initiative.into_iter().enumerate() {
turn_order.push(Turn {
index,
attacking: None,
});
groups[index].order = i;
}

let targeted = vec![false; groups.len()];

Ok(Battle {
groups,
targeted,
turn_order,
separator,
immune_system_picking_order: vec![],
infection_picking_order: vec![],
})
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-24-01.txt");

let battle = parse_input(path)?;

println!("Part 1: {:?}", battle.clone().simulate());
println!("Part 2: {:?}", battle.find_smallest_boost().0);

Ok(())
}

Finland the finnish pmf Vaasa, Pohjanmaa  No.2732323 

where anusoid @
Dice rollRolled 1d10. Result: 7.

Palestine, State of the palestinian edgemaster Khan Yunis, Gaza  No.2732374 

File: 1547977212896.txt (12.07 KB, input-25-01.txt)

day 25:

use std::fmt;
use std::fs::File;
use std::io::{BufRead, BufReader, Error as IoError};
use std::num::ParseIntError;
use std::path::Path;
use std::str::FromStr;

#[derive(Debug)]
enum Error {
Io(IoError),
ParseInt(ParseIntError),
Invalid,
}

impl From<IoError> for Error {
fn from(error: IoError) -> Self {
Error::Io(error)
}
}

impl From<ParseIntError> for Error {
fn from(error: ParseIntError) -> Self {
Error::ParseInt(error)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(e) => fmt::Display::fmt(e, f),
Error::ParseInt(e) => fmt::Display::fmt(e, f),
Error::Invalid => write!(f, "invalid input"),
}
}
}

#[derive(Debug)]
struct Coordinate {
x: i8,
y: i8,
z: i8,
t: i8,
}

impl Coordinate {
fn distance(&self, other: &Self) -> i8 {
(self.x - other.x).abs()
+ (self.y - other.y).abs()
+ (self.z - other.z).abs()
+ (self.t - other.t).abs()
}
}

impl FromStr for Coordinate {
type Err = Error;

fn from_str(string: &str) -> Result<Self, Self::Err> {
let mut split = string.split(',');
let (x, y, z, t) = match (split.next(), split.next(), split.next(), split.next()) {
(Some(x), Some(y), Some(z), Some(t)) => {
(x.parse()?, y.parse()?, z.parse()?, t.parse()?)
}
_ => return Err(Error::Invalid),
};

Ok(Coordinate { x, y, z, t })
}
}

fn parse_input(path: &Path) -> Result<Vec<Coordinate>, Error> {
let coordinates = BufReader::new(File::open(path)?)
.lines()
.map(|line| line.map_err(Error::from).and_then(|s| s.parse()))
.collect::<Result<Vec<Coordinate>, Error>>()?;

if !coordinates.is_empty() {
Ok(coordinates)
} else {
Err(Error::Invalid)
}
}

fn explore(vec: &[bool], len: usize, index: usize, visited: &mut [bool]) {
for i in vec
.chunks_exact(len)
.nth(index)
.unwrap()
.iter()
.enumerate()
.filter_map(|(i, &close)| if close { Some(i) } else { None })
{
if !visited[i] {
visited[i] = true;
explore(vec, len, i, visited);
}
}
}

fn constellations(coordinates: &[Coordinate]) -> i32 {
let len = coordinates.len();
let mut vec = vec![false; len * len];
for (i, coordinate) in coordinates.iter().enumerate() {
for (j, other) in coordinates.iter().enumerate().skip(i + 1) {
if coordinate.distance(other) < 4 {
vec[i * len + j] = true;
vec[j * len + i] = true;
}
}
}

let mut counter = 0;
let mut visited = vec![false; len];

for i in 0..len {
if visited[i] {
continue;
} else {
visited[i] = true;
counter += 1;
explore(&vec, len, i, &mut visited);
}
}

counter
}

fn main() -> Result<(), Error> {
let path = Path::new("inputs/input-25-01.txt");

let coordinates = parse_input(path)?;

println!("Part 1: {}", constellations(&coordinates));

Ok(())
}

Palestine, State of the palestinian spook Khan Yunis, Gaza  No.2732376 

File: 1547977366687-0.png (55.52 KB, 657x591, ClipboardImage.png) ImgOps Google

File: 1547977366687-1.png (102.03 KB, 891x518, ClipboardImage.png) ImgOps Google

finished it yet lola still alive

mashallah

Finland the finnish erp chatlogs Pyhajarvi, Lappi  No.2732382 +1 

>>2732376
Congratulations!
Dice rollRolled 1d10. Result: 2.

Palestine, State of the palestinian hewat Khan Yunis, Gaza  No.2732385 

>>2732382
ty simply ty

i wonder what i should do now (inb4 bronnen v2)

probably ldar coz i'm flying on wednesday

Finland the finnish nerd Vaasa, Pohjanmaa  No.2732390 

>>2732385
lay down and rest
Dice rollRolled 1d10. Result: 7.

Palestine, State of the palestinian cal Khan Yunis, Gaza  No.2732394 


Porkistan ANUSOID Melbourne, Ostrobothnia  No.2732568 +1 

Congrats hon

Palestine, State of the palestinian tom preston Khan Yunis, Gaza  No.2732569 

>>2732568
ty simply ty…

how goes the job hunt

Porkistan ANUSOID Melbourne, Ostrobothnia  No.2732577 

>>2732569
Everyone tells me I shouldnt even bother with a serious job until I have permanent residence. I tried applying to a bunch of white collar positions already and they all told me to fuck off because of my visa.

I sent in an application to Woolworths today
lol


Im okay with it though. I have a h*ckload saved up (could live years w/o working if I wanted to….) and gang minimum wage is pretty high here anyway. If I put up with it for the next year while working on my own projects, I think I'll be fine…..

Palestine, State of the palestinian gayboy Khan Yunis, Gaza  No.2732586 

>>2732577
just marry your hoe and get a spouse visa smh

your gonna do it anyway,,,

Turkey the turkish lolicon Istanbul, Istanbul  No.2732638 +2 

>>2732586
what a vapid whore

Palestine, State of the palestinian morty Khan Yunis, Gaza  No.2732649 

>>2732638
eaaa pmf what are you up to nowadays

preparing for your silicon valley interview marathon on leetcode? reading up CTCI/EPI? brushing up your portfolio? checking up on new additions to scala in the recent versions? asking your uncle to do mock interviews with you?

Turkey the turkish radan Istanbul, Istanbul  No.2732654 

>>2732649
aee little nword need 2 keep a low profile

Palestine, State of the palestinian rex's owner Khan Yunis, Gaza  No.2732660 

>>2732654
PM me :DDD

Netherlands  No.2733234 

whatever nerds

France Proxy the french meat toilet Roubaix, Hauts-de-France  No.2734127 

>>2732577
>I sent in an application to Woolworths today
if you take a job from wolly's you're literally taking some kid's first job

Palestine, State of the palestinian spreadsheeter Khan Yunis, Gaza  No.2734137 

>>2734127
can you help a brutha out with his first aussie job

France Proxy the french schizo Roubaix, Hauts-de-France  No.2734153 

File: 1548040084834.png (149.42 KB, 350x350, Levi_Ackerman.png) ImgOps Google

>>2734137
probably can't help him since rodi is already rich and enganged

i can only help people on hell mode and ultra orphans (they're me)

Palestine, State of the palestinian bigdickbitch Khan Yunis, Gaza  No.2734159 

>>2734153
he's not engaged (yet)

also i don't think he can do better than Woolworths or w/e without a proper visa

France Proxy the french pleb Roubaix, Hauts-de-France  No.2734167 

>>2734159
i know of europoos and ameri becoming recruiters as a temp HR for those sketchy job centers

the pay is probably 20-40$/hr but the location is in the CBD/Dockland

i guess if he really wanted to take advice from random people on IB he could just google job recruiter position in Dockland and South Melbourne

Palestine, State of the palestinian sissy hunter Khan Yunis, Gaza  No.2734171 


France Proxy the french speedrunner Roubaix, Hauts-de-France  No.2734174 

>>2734171
u have to go to the horse school

Palestine, State of the palestinian hiv carrier Khan Yunis, Gaza  No.2734176 +1 

>>2734174
maybe i will :)

we rented a car to drive to vienna among other things

Netherlands  No.2736222 +7 

File: 1548178893613.jpg (1.04 MB, 1439x2028, jet prostitution laborator….jpg) ImgOps Exif Google


Porkistan ANUSOID Melbourne, Ostrobothnia  No.2738828 +3 


Portugal the portuguese lumpenprole Carnaxide, Lisboa  No.2738932 

>>2736279
Some twitch thot

United States the american hetnigger Bellevue, Washington  No.2738939 

>>2736279
ronen ul

Hungary the hungarian niggersachsen Budapest, Budapest  No.2740774 


Porkistan ANUSOID Melbourne, Ostrobothnia  No.2743486 

Go's default html parser sucks compared to SSAX for Scheme

S expressions are just such a natural bbc way to express html

Netherlands  No.2744609 

File: 1548634834072.png (95.51 KB, 1182x420, 1.png) ImgOps Google

your opinion, /g/ ?

Porkistan ANUSOID Melbourne, Ostrobothnia  No.2745703 

>>2744609
Unironi true
Fuck STEMlords

Belarus the belarusian soya dad Minsk, Minskaya voblasts'  No.2745731 +1 

662 posts and 146 image replies omitted. Click reply to view.

This board needs to die

United States the american ostrobothnia Bellevue, Washington  No.2745732 +1 

>>2745731
no, just anus rodi's techno-jihadist cell

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2745759 

>>2743486
who the hell uses scheme nowadays?

Porkistan ANUSOID Melbourne, Ostrobothnia  No.2745796 

>>2745759
Based one's

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2745817 

>>2745796

This article investigates why the lisp computer language is no longer widely used. Long ago, this language was at the forefront of computer science research, and in particular artificial intelligence research. Now, it is used rarely, if at all. The reason for this failure is not age. Other languages of similar heritage are still widely used.

Some "old" languages are FORTRAN, COBOL, LISP, BASIC, and the ALGOL family. The primary difference between these languages is who they were designed for. FORTRAN was designed for scientists and engineers, for whom solving equations on computers was the primary task of programming. COBOL was designed for businesses, being especially expressive so that business people could take advantage of the computer age. LISP was designed by computer scientists, and was expressive enough for research into the fundamentals of computation. BASIC was designed for beginners to learn programming. Finally, the ALGOL language was modified by computer programmers, and evolved into a huge family of popular languages such as C, Pascal and Java.

Some of the above languages are no longer quite as popular as they once were. This will be the definition of "failure" we will use here. The question is why did they fail? The first stand-out is COBOL. Unfortunately, its design to be humanly-readable by business people was its downfall. Businesses found that it was possible to hire programmers to look after their computers. Programmers would then gravitate to languages designed for them, rather than their managers. Thus over time, more and more business functions would be programmed in languages such as VB, C, C++ and Java. Now, only relic software tends to be still be written in the language.

BASIC suffered a different fate. It was the language of beginners. Those just learning to program on microcomputers would use the in-built BASIC language to start off with. As time progressed, microcomputers were replaced by personal computers running Microsoft operating systems, or macintoshes running Apple's. The language evolved with time, becoming Visual Basic once the desktop paradigm arrived. Since it could be used by those with little programming skill, it replaced COBOL for a while. Why pay for an expensive compiler, if a cheap interpreter that comes with your machine is all you need? Recently, Microsoft has moved to the .Net system, leaving VB behind. Its replacement, C#, is an ALGOL family member closely related to Java.

FORTRAN usage has waxed and waned throughout the years. At one stage, nearly all science codes were written in it. Its advantage was that there were no pointers in the language, and recursion was disallowed. This meant that all data reference locations were able to be compile-time constants. FORTRAN compilers could use this extra information to make extremely fast programs. Unfortunately, as time progressed fixed sized arrays as data structures became obsolete. Now, science works with arbitrary shaped grids, and even more complex representations of the real world. This required the addition of pointers to the language. Around the time that happened, FORTRAN went into decline. Now it is relegated to high performance computing workloads where new parallel matrix and vector operations recently added to the language still give it the performance edge.

The ALGOL language family succeeded. The reason for this is that these were the languages written by programmers for programmers. As time progressed, these evolved into the system and application languages most commonly used today. Their advantage was that the more programmers that used them, the more the languages improved, and the more programs that were written in them. This provided a virtuous cycle, where more programmers were in turn hired to work on the programs that were written. This is an example of the network effect. The "worth" of a system is proportional to the square of the number of users of it, due to the number of interactions between users scaling at this rate.

So why did the Lisp programming language family end up on the failure side? Some say it is due to the syntax. Lisp is notorious for its parentheses. I do not believe that is the reason. Many users of Lisp say that formatting quickly allows them to match bracket-pairs. Also, soon after the invention of the language super-brackets were created to quickly close off an arbitrary number of open brackets. This language feature is rarely used today. Finally, syntax-understanding editors have made most of the layout problems of Lisp nonexistent in this age.

Another common complaint against Lisp is that it is a functional language. Could this be the reason for failure? Amongst all the early important languages, it alone is functional in nature. Unfortunately, I don't think reality is this simple. Lisp contains imperative features, and the ALGOL family can be used in a purely functional manner. If one wishes to code to a certain paradigm, certain languages may make that choice easier to make. However, modern languages are flexible enough to support many programming paradigms, and there is no reason a mostly imperative Lisp might not exist.

Perhaps the problem with Lisp was that it used a garbage collector? Again, amongst the early important languages, it alone had one. Garbage collection requires more memory and computational resources than manual memory management. Could the lack of memory and low performance of early computers have held Lisp back enough to slow its adoption? Again, I do not think this was the case. The complex programs Lisp was used to create would require something with the complexity of a garbage collector to be written any way if they were implemented in another language. The proverbial statement that any complex enough program eventually contains a poorly written implementation of Lisp does hold some weight after all.

The reason Lisp failed was that it was too successful at what it was designed for. Lisp, alone amongst the early languages was flexible enough that the language itself could be remade into whatever the user required. Programming with the other early languages involved breaking a task into small sub-tasks that could then be implemented. The larger tasks could then be implemented in terms of the smaller ones. Lisp was different, due to its power, a programmer would be able to design a domain-specific language that would perfectly solve the task at hand. Due to the orthogonality of the language, the extensions written would work seamlessly with the core language.

So what is the problem with creating domain-specific languages as a problem solving technique? The results are very efficient. However, the process causes Balkanization. It results in many sub-languages all slightly different. This is the true reason why Lisp code is unreadable to others. In most other languages it is relatively simple to work out what a given line of code does. Lisp, with its extreme expressibility, causes problems as a given symbol could be a variable, function or operator, and a large amount of code may need to be read to find out which.

The reason Lisp failed was because it fragmented, and it fragmented because that was the nature of the language and its domain-specific solution style. The network effect worked in reverse. Less and less programmers ended up talking the same dialect, and thus the total "worth" ended up decreasing relative to the ALGOL family.

If one were designing a language now, how could this problem be prevented? If expressibility is the goal of the language, then it must somehow be moderated. The language must have deliberate limitations that allow for readability of code written in it. Python is a successful language where this has been done, where some of these limitations are hard-coded, and others exist via the use of convention.

Unfortunately, so much time has passed, and so many Lisp variants have been created, that yet another new language based upon it is probably not the answer. There simply will not be enough users to make a difference. Perhaps the solution is to slowly add Lisp-like features to languages within the ALGOL family. Fortunately, this seems to be what is happening. The newer languages (C#, D, Python etc.) tend to have garbage collectors. They also tend to be even more orthogonal than the older languages. The future may eventually contain a popular language that behaves much like Lisp.

Porkistan ANUSOID Melbourne, Ostrobothnia  No.2746439 

>>2745817
I dont disagree
Lisp is a "hackers language" that empowers individuals at the expense of collaboration
That's not a failure; it's just a different use case

Im a solitary 62kg cuck. I dont care about market share or "success" of a language because it doesnt matter to me

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2747297 

>>2746439
hackerman

Palestine, State of the palestinian telejerker Khan Yunis, Gaza  No.2749277 


Finland the finnish pizza Vaasa, Pohjanmaa  No.2752448 


Dice rollRolled 1d10. Result: 10.

Canada the canadian hotshot Quebec, Quebec  No.2752718 +1 

go up

Porkistan ANUSOID Melbourne, Ostrobothnia  No.2754855 


Palestine, State of the palestinian zinger Khan Yunis, Gaza  No.2757097 

boom

Netherlands  No.2757420 

File: 1549383614132.png (341.35 KB, 592x411, liz graphics.png) ImgOps Google

uuuh… girls know about computers too you silly incels

United States idiotretard Bismarck, North Dakota  No.2757424 

>>2757420
install gentoo, veronica, you vapid whore

Netherlands  No.2757425 

>>2757424

gentoo is so 2016, the cool kids use void now

United States idiotretard Bismarck, North Dakota  No.2757441 

>>2757425
void is nice, but I prefer the autism involved in source-building because computers are my monetized cope

Netherlands  No.2757442 

>>2757441

but what about the package manager being a giant python script tho

United States idiotretard Bismarck, North Dakota  No.2757445 

File: 1549385416445.jpg (101.6 KB, 600x600, 1535324994033.jpg) ImgOps Exif Google

>>2757442
python is the slowest fucking thing people still use but I have had no problems with it, personally; you just feed it your global settings, some environment configs for things you specfically don't want to build with default settings, and it just goes

you could convert me for real if you could teach me how to feed pacman options to build the entire system from source

Moldova, Republic of the moldovan pederast Chisinau, Chisinau  No.2757855 +1 

https://www.scmagazine.com/home/security-news/a-new-stealer-written-in-golang-go-programming-language-has-been-detected-as-part-of-a-new-trend-in-cybercriminals-writing-malware-in-go/
>Like most applications written in Go, the malware’s code is bulky and the malware’s compiled binaries are usually big so the observed sample was packed with UPX to minimize its size researchers said.

Brazil gopnik!Wo0bn/JfrQ Sao Paulo, Sao Paulo  No.2757940 

>>2757855
hmmm…

Turkey the turkish river crosser Polatli, Ankara  No.2758654 +2 

File: 1549456474266.png (641.29 KB, 600x566, Ekran Alıntısı.PNG) ImgOps Google

based kchennai

Turkey page 22 Polatli, Ankara  No.2761520 +1 

File: 1549627978626.png (862.78 KB, 603x600, page 22.PNG) ImgOps Google

page 22

Sweden Vastra Goeteborg, Vastra Gotalands lan  No.2761723 +1 

>>2758654
good pic

Porkistan ANUSOID Melbourne, Ostrobothnia  No.2764217 +1 


Turkey page 23 Many Rivers to Cross Polatli, Ankara  No.2766837 +2 

File: 1549931781295.png (432.86 KB, 799x599, @hacker.helper.PNG) ImgOps Google

well, bernd?

Netherlands  No.2767382 +2 

File: 1549982412462.png (51.71 KB, 606x452, 34.png) ImgOps Google

sooo true

United States the american individual 1 New Berlin, Wisconsin  No.2767391 +2 

>>2767382
yeah but in my mind tech bros are the ones with communications skills instead of hacker knowledge aka future managers

shes referring to the assburgers who are really really smart but act like self-righteous assholes (dont bother me, im smarter than you and trying to concentrate on this very complex code!!) (dont tell me to do other things, im compiling!)

Porkistan ANUSOID Melbourne, Ostrobothnia  No.2767458 +1 

>>2767391
>dont bother me, im smarter than you and trying to concentrate on this very complex code!!
Literally nothing wrong with this

Netherlands  No.2767517 

>>2767391

xe's referring to anime avatar twitter users telling recently laid-off buzzfeed journos to learn to code

Canada the canadian cbronnenite Montreal, Quebec  No.2767561 

>>2767391
"Hehe I sure showed them by making my code run 10ns faster on this non-critical part of the process"

United States idiotretard Bismarck, North Dakota  No.2767579 +1 

this thread (and the funposting in this thread) has converted me

I will learn Golang now

Palestine, State of the palestinian big black cock Khan Yunis, Gaza  No.2767600 

>>2767579
learn rust ret

>>2767561
is there anything more to life than this?

United Kingdom 🍌 Belper, England  No.2767648 +3 

Hmm cringe

Palestine, State of the palestinian horse rapist Khan Yunis, Gaza  No.2769819 

I've seen things you people wouldn't believe. An entire class of bugs eliminated by a simple phantom type parameterized by terms promoted to the type level. I watched type-driven generation of programs in outer tests. I witnessed equality of type indices by means of dependent pattern matching over singletons in the middle of production code. ReaderT temporarily turned into StateT by the Codensity transformer. Generalized algebraic data types, type families, functional dependencies, higher-rank types, polymorphic kinds, constraint kinds, semigroupoids, monad morphisms, comonads, higher-kinded classes, Kleisli functors, indexed monads, algebraic effect handlers, dependent-maps, zippers, type roles, non-regular data types, polymorphic recursion, RecursiveDo, defunctionalization, final tagless encoding, prismatic error handling, void types, type-safe file paths and REST APIs, recursion schemes, type-driven strictness, Church-encoded free monads, left and right Kan extensions, levity polymorphism, polyvariadic functions, dependent data families, continuation-passing-style existential typing, parameterized higher-order abstract syntax. All those types will be lost in runtime, like tears in rain. Time to compile.

Sweden Proxy the swedish horse rapist  No.2769832 

Haha, what a cuck you are >>2556417

You never deliver what you promise. You retard.

Sweden Proxy the swedish bearmode  No.2769835 

>>2769819
WTF did I just read?

Do you understand it ronen? What magic is this?

Palestine, State of the palestinian hideloc brit Khan Yunis, Gaza  No.2769837 

>>2769835
it's your typical haskell category theory circlejerk copypasta

Palestine, State of the palestinian tree hugger Khan Yunis, Gaza  No.2770395 




[Return][Go to top] [Post a Reply]
[ home ] [ int ] [ biz / edi ] [ vir / cuck ] [ mod ] [ meta / test / arch ] [ wiki / map ] [ register / login / my threads / replied threads / followed threads ]