[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

/vt/ is now archived.Become a Patron!

/g/ - Technology

View post   

[ Toggle deleted replies ]
File: 441 KB, 1280x1815, kissu8.jpg [View same] [iqdb] [saucenao] [google] [report]
68705137 No.68705137 [Reply] [Original] [archived.moe] [rbt]

old thread: >>68700021

What are you working on, /g/?
>when you take the pair programming while crossdressing meme too far and you both go on a date for some quality peer bonding and you get lost in the moment and kiss him?!? >///<

>> No.68705151
File: 415 KB, 557x618, 415123.png [View same] [iqdb] [saucenao] [google] [report]

>OP pic

>> No.68705164

today I wrote assembly for a little robot tank to solve obstacle courses with a simple wall-following algorithm

>> No.68705172
File: 224 KB, 592x585, sleep tight.png [View same] [iqdb] [saucenao] [google] [report]

Good night, /dpt/.

>> No.68705178

g'night bro

>> No.68705182

I woke up after only 3 hours of sleep for some reason. Waiting untill the supermarkets open and then it will probably be a wasted day.

>> No.68705191
File: 59 KB, 540x501, 01824671.jpg [View same] [iqdb] [saucenao] [google] [report]

i just read the greentext that i somehow missed in the OP
i guess this is a good time to log off /dpt/

>> No.68705204

If you must do it with a recursive function instead of generating the permutations from numbers like >>68704533, then this seems less retarded to me. But maybe it's just me.
This seems more logic; permute or don't permute the element and recurse on the substring.

void recursive_permute(char *s, int idx) {
if (s[idx]== '\0') {
printf("%d - %s\n", count++, s);
recursive_permute(s, idx+1);
int i;
for (i=0; i<strlen(arr); ++i){
if (s[idx]==arr[i]){
char *temp = malloc(strlen(s)+1);
strcpy(temp, s);


int main(){
recursive_permute(str, 0);
return 0;

>> No.68705210

good night
have well-typed dreams

>> No.68705211

The picture would have been fine, it's just the extra text that's unnerving.

>> No.68705220

>The picture would have been fine
It has nothing to do with programming or any of the /dpt/ mascots like anzu, yuno or yuki. At least shop a sicp in there somewhere.

>> No.68705253

And if you do want to use that dive function, at least make it so it prints at the start so you don't have to deal with the no l33t case separately.

void dive(char *s, int next) {
printf("%d - %s\n", count++, s);
int i, j;
for (i = next; i < strlen(s); i++) {
for (j = 0; j < strlen(arr); j++) {
if (s[i] == arr[j]) {
char *temp = malloc(strlen(s) + 1);
strcpy(temp, s);
temp[i] = replace[j];
dive(temp, i);

>> No.68705273
File: 83 KB, 660x495, towers of hanoi.jpg [View same] [iqdb] [saucenao] [google] [report]

>At least shop a sicp in there somewhere.
True, that would make it programming related.
>/dpt/ mascots like anzu, yuno or yuki.
Can you please explain to me how these anime children are /dpt/ mascots?

>> No.68705274

It's C so I have no idea whats going on when you use those functions like malloc

>> No.68705295

They've all had /dpt/ OP images made for them and were used for a large amount of time. Maybe try lurking first before posting.

>> No.68705303
File: 816 KB, 504x540, 1533317981736.gif [View same] [iqdb] [saucenao] [google] [report]

>no one realized this doesn't work
fixed version
#include <stdio.h>
#include <stdlib.h>

int tcodetoseconds(char *tc)
int time[3];
char *temp = malloc(sizeof(char) * 2);
short c = 1;
short k = 0;

for (short i = 7; i >= 0 && i < 8; i--) {
temp[c] = tc[i];
if (c == 0) {
c = 1;
time[k] = atoi(temp);
} else {
return time[0] + (time[1] * 60) + (time[2] * 60 * 60);

int main(int argv, char *argc[])
printf("%d\n", tcodetoseconds(argc[1]));
return 0;

>> No.68705320
File: 389 KB, 934x1000, dpt - 01.png [View same] [iqdb] [saucenao] [google] [report]

Don't get too strict otherwise we'll have a lot of this one. This is supposed to be the OP image, remember?

>> No.68705323

stop trying to fit in
you're not good at it

>> No.68705334

Imagine her doing that on your dick

>> No.68705356

How do i return a value without using a function?

>> No.68705362


>> No.68705364
File: 105 KB, 473x496, prog.jpg [View same] [iqdb] [saucenao] [google] [report]

Also acceptable.

>> No.68705366

Use a macro.

>> No.68705379
File: 28 KB, 1008x720, x8eg2wa.jpg [View same] [iqdb] [saucenao] [google] [report]

My brain shat itself for a second there. I thought you meant some other Yuki. It's been so long since I last saw a thread with the backflip image, I forgot it existed.
I still don't see what those other girls have to do with programming though.

>> No.68705384

Sleep tight cute potato.

>> No.68705455

How does one go about achieving satori?

>> No.68705496
File: 50 KB, 500x500, 1381544849239.jpg [View same] [iqdb] [saucenao] [google] [report]

by responding

>> No.68705517
File: 34 KB, 278x278, 1396571416586.jpg [View same] [iqdb] [saucenao] [google] [report]

Speaking of responding, suggest programming projects for me to do to stave off suicide and boredom. These projects can include: anime, video games, ML, AI, C. Please respond.

>> No.68705541

imagine being so devoid of personality and interests that you've been begging for someone to grant you one for 5 days in a row

>> No.68705544

Stop avatarfagging

>> No.68705592

#include <stdio.h>
void main()
const char *S = "FIZZBUzz";
int n = 8;
int size = (2 * n - 1);
int a = 0, b = 0;
for (int i = 0; i < size * size; i++)
a = i % size - (n - 1), b = i / size - (n - 1);
a = (a >= 0 ? a : -a);
b = (b >= 0 ? b : -b);
printf((i + 1) % size ? "%c," : "%c\n", S[a > b ? a : b]);

>> No.68705601

Nice ternary operator, grandpa
let me help you with that

void make_square(int arg) {
int x = arg * 2 - 1;
for (int i = 0; i < x*x; ++i) {
int v[] = {1+(arg - (i % x + 1)) * (((arg - (i % x + 1)) > 0) * 2 - 1),1+(arg - (i / x + 1)) * (((arg - (i / x + 1)) > 0) * 2 - 1)};
std::cout << ' ' << (char)((10 & (((!(i%x)) << 3) | ((!(i%x)) << 1))) | 8) << (v[0]>v[1])*(v[0])+(v[0]<=v[1])*(v[1]);

>> No.68705620
File: 174 KB, 900x630, 1541383369146.jpg [View same] [iqdb] [saucenao] [google] [report]

I wouldn't post it if I had something to do.

>> No.68705625

C is shit

>> No.68705635

make a friend , either real or artificial

>> No.68705649

bash still has the best fizzbuzz.

for x in {1..100}; do
(( x % 3 )) || s+=fizz
(( x % 5 )) || s+=buzz
echo ${s:-$x}

>> No.68705654

ty for the help, I ended up figuring out a much simpler method

>> No.68705687

you can use bit operations instead of conditionals and get the first place in the obfuscated code challenge

>> No.68705733

>Current year
>for loop longer than one line

void make_square(int arg) {
for (int i = 0; i < (arg*2-1)*(arg*2-1); ++i)
std::cout << ' ' << (char)((10 & (((!(i % (arg * 2 - 1))) << 3) | ((!(i % (arg * 2 - 1))) << 1))) | 8) << (1 + (arg - (i % (arg * 2 - 1) + 1)) * (((arg - (i % (arg * 2 - 1) + 1)) > 0) * 2 - 1)>1 + (arg - (i / (arg * 2 - 1) + 1)) * (((arg - (i / (arg * 2 - 1) + 1)) > 0) * 2 - 1))*(1 + (arg - (i % (arg * 2 - 1) + 1)) * (((arg - (i % (arg * 2 - 1) + 1)) > 0) * 2 - 1)) + (1 + (arg - (i % (arg * 2 - 1) + 1)) * (((arg - (i % (arg * 2 - 1) + 1)) > 0) * 2 - 1) <= 1 + (arg - (i / (arg * 2 - 1) + 1)) * (((arg - (i / (arg * 2 - 1) + 1)) > 0) * 2 - 1))*(1 + (arg - (i / (arg * 2 - 1) + 1)) * (((arg - (i / (arg * 2 - 1) + 1)) > 0) * 2 - 1));

>> No.68705824
File: 68 KB, 605x586, 1525519216586.jpg [View same] [iqdb] [saucenao] [google] [report]

>mfw /g/ can't even write a Helmholtz solver

>> No.68705851
File: 492 KB, 538x538, 1526911161799.png [View same] [iqdb] [saucenao] [google] [report]

y-yeah well you write one

>> No.68705861

Rate my solution to >>68704428

use std::io::{self, BufRead};
use std::cmp;

#[derive(Clone, Default)]
struct Node {
c: char,
valid: bool,
nodes: Vec<Node>,

impl Node {
fn insert(&mut self, s: &str) {
let mut curr = self;
let mut chars = s.chars();
let mut index = 0;
let mut saved = None;

for c in chars.by_ref() {
match curr.nodes.binary_search_by_key(&c, |v| v.c) {
Ok(i) => curr = &mut curr.nodes[i],
Err(i) => {
saved = Some(c);
index = i;

for c in saved.iter().cloned().chain(chars) {
curr.nodes.insert(index, Node { c, ..Default::default() });
curr = &mut curr.nodes[index];
index = 0;

curr.valid = true;

fn merge(&mut self, other: &Node) {
for c in other.nodes.iter() {
match self.nodes.binary_search_by_key(&c.c, |v| v.c) {
Ok(i) => {
if c.valid {
self.nodes[i].valid = true;

Err(i) => self.nodes.insert(i, c.clone()),

fn add_xform(&mut self, xform: &(char, char)) {
let (o, n) = xform;

for c in self.nodes.iter_mut() {

let old = self.nodes.binary_search_by_key(o, |v| v.c);
let new = self.nodes.binary_search_by_key(n, |v| v.c);

match (old, new) {
(Ok(i), Err(j)) => {
let mut node = self.nodes[i].clone();
node.c = *n;
self.nodes.insert(j, node);
(Ok(i), Ok(j)) => {
let (l, r) = self.nodes.split_at_mut(cmp::max(i, j));
let (o, n) = if i < j { (&l[i], &mut r[0]) } else { (&r[0], &mut l[j]) };

_ => {},

fn print_r(&self, buf: &mut String) {
if self.valid {
println!("{}", buf);

for c in self.nodes.iter() {

fn print(&self) {
let mut buf = String::new();
self.print_r(&mut buf);

This barely can't fit in a single 4chan post, so I'll post the main function separately.

>> No.68705867

fn main() -> io::Result<()> {
let stdin = io::stdin();
let xforms = [('a', '@'), ('e', '3')];

let mut trie = Node::default();
for s in stdin.lock().lines() {

for t in xforms.iter() {


>> No.68705878
File: 7 KB, 265x265, 1455596028755.jpg [View same] [iqdb] [saucenao] [google] [report]

>mfw /g/ can't even write a Helmholtz solver

>> No.68705887

you first loser

>> No.68705936
File: 407 KB, 617x783, 63963495_p15.png [View same] [iqdb] [saucenao] [google] [report]

Fuck it, that's it. I've wanted to make something with AI but it's so fucking niche and deep of an area that I just get lost in all the prerequisites before getting to the actual thing but this time I'll do it. I won't post about projects until I've made an AI capable of suggesting them to me itself.

>> No.68705965

what ISA?

>> No.68705992
File: 35 KB, 655x302, Screenshot_20181129_083757.png [View same] [iqdb] [saucenao] [google] [report]

wtf I can't even.

pic related because 4channel won't let me post this for some reason
this will produce some redundant output because there's no mechanism to filter results that were reached multiple times, but you could easily prune them with a map or whatever

>> No.68705994

for me its ansi c

>> No.68706080

>can't post code to 4channel
>takes a screenshot instead of using a pastebin-like service
just kill yourself you gorilla nigger

>> No.68706097

there you go faggot

>> No.68706140
File: 53 KB, 500x636, c66d36d6_bf1f_4c3b_8f35_78169c879.jpg [View same] [iqdb] [saucenao] [google] [report]

>searching for the perfect language
>knowing full well it will never exist
>keep searching anyway

>> No.68706149

I don't want it, I was just pointing the complete lack of sense in your actions

>> No.68706222

Make it yourself.

>> No.68706425


>> No.68706446

Leader Election Yo-yo algorithm in MPI

>> No.68706521

It's called Rust

>> No.68706527

Wait, they got rid of the BC? Nice.

>> No.68706561
File: 87 KB, 700x612, perfect language.png [View same] [iqdb] [saucenao] [google] [report]


>> No.68706574
File: 100 KB, 900x900, 52325325325.jpg [View same] [iqdb] [saucenao] [google] [report]

Whats your opinion on this YT channel bros, i am quite the fan

>> No.68706590

I'm seeing it pushed on my yt home page daily but most of it is webdev
Don't like it much outside of the "trivia-like" talks from various cons

>> No.68706655

5min article has more info than an 50min yt video

>> No.68706727

both the 5 min article and most 50 min yt video have very shallow information depth tho, which is the root of the problem
the hour long vscode presentation was the one good thing I've found on that channel because it's just rapid-firing tooltips for a full hour

>> No.68707167

sleep well, chito.

>> No.68707190 [DELETED] 

feel free to contribute to the /g/ rekt bread

>> No.68707294

mods = gods
Haskell did nothing wrong.

>> No.68707339

How bad is the behaviour of a direct mapped cache compared to caches with higher associativity when you expect that the working set is going to be smaller than the cache in 50% of cases and less than 150% of the cache in 90% of cases?

>> No.68707627

How do u rotate a binary tree

>> No.68707632

notes is a function
notes ()
cat $HELP;
printf ">";
while read line; do
case $line in
select note in $NOTEDIR/*;
rm $note;
select note in $NOTEDIR/*;
$EDITOR $note;
echo "Name of the new note:";
read NAME;
cat $HELP
printf "\nNotes:\n";
ls --color -h $NOTEDIR/ | tr ' ' '\n';
printf "\n"
printf "\n>";
echo ""

My Google Keep replacement in the terminal

>> No.68707654

I might have found the bug that I searched for for months.

>> No.68707669

Think about it upside down/sideways?

>> No.68707678


>> No.68707728

Quote your variables or bad things will happen.

>> No.68707739

you're right, I'm retarded
thank you!

>> No.68707769
File: 695 KB, 420x236, original.gif [View same] [iqdb] [saucenao] [google] [report]

Today I did the Hackerrank question "Sock Merchant" which asked me to find out how many pairs of matching socks there were in an array of differently coloured socks.
This is my code:
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char* readline();
char** split_string(char*);

int sockMerchant(int n, int ar_count, int* ar) {
//Find out how many matching pairs of socks:
int valcheck;
int checked[n]; //Array of checked indices
bool valchecked = false;
int totalpairs = 0;
for(int i = 0; i < n; i++){
valcheck = ar[i];
//If sock already in pair skip pairing
for(int j = 0; j < i; j++){
if(i == checked[j] && i!=0){
valchecked = true;
//Check for other sock to make pair
for(int k = i+1; k < n; k++){
if(valcheck == ar[k]){
checked[i] = k;
valchecked = false;
return totalpairs;

>> No.68707780

don't say it
nobody say it

>> No.68707782

It's good that you're making a habit of doing this every day but I hope you're not just doing a single exercise. They're pretty easy and you should be able to get through a bunch of the easier ones.

>> No.68707808

For me, it’s F#

>> No.68707815

Nice O(n^2) solution.
Just sort the input and loop over it once to count adjacent values.

>> No.68707816

fshit doesn't even have higher kinded polymorphism or rank n types

>> No.68707818

God C is disgusting

>> No.68707823

>int checked[n];
Not valid standard C

>> No.68707826

No, he just wrote ugly C. I've seen lots of very nice-looking C.
Putting the occasional blank line to separate logical blocks of code goes a long way. Paragraphs, basically.

>> No.68707827

Yes it is.

>> No.68707836

Variable Length Arrays are perfectly standard.
Don't tell a newbie they're not. That's morally black.

>> No.68707837

No it isn't, n has to be a compile time constant which it is not. Many compilers support this though.

>> No.68707843

VLAs were standardized in C99. They were made optional to support in C11, but they're still standard.

>> No.68707855

Nevermind MSVC is just shit

>> No.68707862

MSVC isn't even a C compiler. It's a C++ compiler masquerading as a C compiler.

>> No.68707869
File: 6 KB, 641x134, Capture.png [View same] [iqdb] [saucenao] [google] [report]

Can confirm.

>> No.68707874

>Array declarators
Read it again. You did read the standard before you comment on what's standard or not right?
>Nevermind MSVC is just shit
Why would you expect msvc to implement the C standard? They're notoriously bad at this even where they claim they try. It's almost malicious.

>> No.68707913

Shit i never use

>> No.68707949

I will let it run for some more, if it doesn't crash I am opening a bottle of wine later.

>> No.68707952
File: 388 KB, 401x534, what am i in for.png [View same] [iqdb] [saucenao] [google] [report]

what am i in for lads? anyone else reading this?

>> No.68707958

Putting Mona Lisa on the front is pretty tasteless.

>> No.68707968

its risc-ky??

>> No.68707980
File: 2.95 MB, 480x270, 1376438639796.gif [View same] [iqdb] [saucenao] [google] [report]

best of luck anon

>> No.68707995
File: 304 KB, 1024x768, programming sock.jpg [View same] [iqdb] [saucenao] [google] [report]

How comfy should I expect to get by going into STM32 32-bit ARM microcontroller stuff?

>> No.68708027

It is a pretty strange choice, that cover just doesn't look like a computer book.

>> No.68708115


Pretty goddamn comfy

the STM stuff is crazy easy to deal with

I love their eval boards too

>> No.68708191

>I love their eval boards too
I consider buying one of their development board and work on it on a hobby level until I get confident enough to claim proficiency in it on my resume.
Assuming I don't have an academic computer science background but read my SICP and am somewhat familiar with arduino, how much trouble should I expect to get started from beginner to "doing interesting stuff" tier?

>> No.68708237
File: 17 KB, 264x293, 264px-Pointers.svg.png [View same] [iqdb] [saucenao] [google] [report]

pointers are art

>> No.68708262

until you have to actually manage someone's pointers, then it will always be hot garbage.
and you from 1 year ago is someone else

>> No.68708298

>but read my SICP


>am somewhat familiar with arduino

more or less useless, depending on how you used the Arduino.

well, okay, not completely - STM makes dev kits that play nice with the Arduino IDE now - but that's not going to win you resume cred.

>how much trouble should I expect to get started from beginner to "doing interesting stuff" tier?

it's embedded C-family. you're going to have to wrap your head around a bit of both the MCU stuff - GPIO mapping, Interrupts, etc. - as well as the C-family stuff. Much of the MCU side of things is hidden from you in Arduino, so that will likely take some adjusting to, but the C stuff should come pretty easily. Just grab one of the basic Discovery kits, download Keil, and start playing.

it's not rocket science. give it 6 months to a year of dedicated work and you'll figure it out pretty quick.

if you're hoping to pin hobby embedded stuff on your sleeve for an interview, put together proper documentation and portfolio it or no one will take you seriously. you-tube videos are nice.

>> No.68708302

That's what smart pointers are for

>> No.68708331

art is not easy, my friend
that's why there aren't a lot of Michelangelos and too much Pollocks

>> No.68708358

Lurking around for guides I found this book http://hades.mech.northwestern.edu/index.php/NU32
I consider using it as my main resource guide. It also goes from the bottom up using linux from what I got skimming it.
I don't know if it's up to date but I don't think it matters much.

>> No.68708396

I might be totally wrong. This was a book I found when I looked how to get into embedded stuff. Might not even be related to the STM32 I was posting about.

>> No.68708401
File: 19 KB, 499x357, 1524559896787.jpg [View same] [iqdb] [saucenao] [google] [report]

>tfw just failed my basic programming (python specifically) exam
Cheers /dpt/, I'm going to drown my low iq brain with some alcohol now

>> No.68708419

choose one
python is a scripting language

>> No.68708487


>> No.68708510

yellow snake bad

>> No.68708536
File: 386 KB, 1280x720, smug_anime_girl.gif [View same] [iqdb] [saucenao] [google] [report]

>python took 13 minutes to respond

>> No.68708557

For me, it's Rust.

>> No.68708572

oh hey, first time you post a problem I already solved
def sockMerchant(n, ar):
colors = {}
pairs = 0
for i in ar:
if i in colors: colors[i] += 1
else: colors[i] = 1
for i in colors:
pairs += colors[i]//2

>> No.68708608


>> No.68708639

What does rust have to do with /v/?

>> No.68708655
File: 13 KB, 579x119, 1539748747469.png [View same] [iqdb] [saucenao] [google] [report]


>> No.68708683

Working on my maths with some fun linear algebra. I think there's an order to these loops that makes it faster but I can't figure it out without messing up the matrix multiplication.
for (i = 0; i < c_rows; i++) {
for (j = 0; j < c_cols; j++) {
int sum = 0;
for (k = 0; k < b_rows; k++) {
sum += a[i * a_cols + k] * b[k * b_cols + j];
printf("%d * %d + ", a[i * a_cols + k], b[k * b_cols + j]);
c[i * c_cols + j] = sum;

>> No.68708694


Nah mate, that's PIC, you're looking for an ARM manual for STM products.

ARM has a much better ecosystem of tools and resources around it. Working in PIC off an old manual is going to be an exercise in sadomasochism. Crash course in C section might be slightly helpful, but Keil plays nice with fully updated GCC so even that's a bit archaic at this point.
sounds like you might need to take a step back and look at the top level of embedded industry before you dive in here.

>> No.68708702

>hurr scripting _programming languages_ aren't programming languages
You probably feel like a badass because you know what pointers are

>> No.68708723

>scripting _programming languages_

>> No.68708729


actually, I take that back a bit


looking at it more closely, there's probably some good resources in there. watch the videos, but be aware that there will be differences when the rubber hits the road.

>> No.68708734


>> No.68708756

are we winning AoC this year bois?

>> No.68708757


>> No.68708764

not a chance the chink faggot is too good

>> No.68708775

Thanks for the tips.
My original plan was to buy one board for chistmas or something, get a toy example to compile and run properly. Then to modify it a little. And eventually to go back to the start and actually try to understand what I'm doing.

You suggested Keil, isn't there something more bottom up (without being too inane) on linux, or am I burring myself into a corner for not using a window machine?

Also, should I buy like 2 or 3 boards, jsut to avoid those "wtf this can't be happening! must be a hardware problem!!!1!!" types of brainfarts?

>> No.68708791

where's our anon hero https://archive.rebeccablacktech.com/g/thread/63947726

>> No.68708794

Fuck off.

>> No.68708800

y u mad bro?

>> No.68708825


there's a couple easier ways to do it faster than O(n^3)

Strassen's Algorithm comes to mind, learned that way back when.

people research this kind of shit constantly, might be worth it to look it up.

>> No.68708848

Right now I want to get it right to some extent and then move on to other things. When I come back I'll look into that stuff (I've already been looking at it a bit). I'm just struggling with understanding what I can change without messing up the result.

>> No.68708992


>> No.68709062
File: 13 KB, 1252x287, file.png [View same] [iqdb] [saucenao] [google] [report]

>> No.68709097
File: 196 KB, 580x580, 1513299129258.jpg [View same] [iqdb] [saucenao] [google] [report]

fuck they're onto us

>> No.68709110

Well, it's not wrong

>> No.68709231

Lisp is the most powerful programming language.

>> No.68709291

lisp is not a programming language

>> No.68709308

I can't deny that

>> No.68709317

>reddit opinions
on the side note this is 4channel now,not 4chan.

>> No.68709329

nsfw /g/ when?

>> No.68709346

Just bring back /prog/.

>> No.68709355
File: 339 KB, 1280x720, 1534699199280.jpg [View same] [iqdb] [saucenao] [google] [report]

>red /prog/ board
i want this so badly

>> No.68709356

we had a /g/ nsfw... it was great

>> No.68709357

that's not even reddit my dude

>> No.68709369

everything is reddit now
4channel is reddit

>> No.68709400

Opinions themselves are reddit tier.
Happy now?

>> No.68709403

hn is reddit

>> No.68709413


>> No.68709414
File: 65 KB, 712x750, CNjWgStUsAAp3wY.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.68709425


>> No.68709433

i actually didn't realise the domain change. i still typed 4chan.org/g/dpt and never looked back at the domain.


>> No.68709436

Any mochabros know what the FUCK is happening here.

it('removes a thread and its comments', done => {
title: "beforeEachTestTitle"
.then((thread) => {
return request(app)
.delete("/api/thread/" + thread._id)
.then(() => {
return Thread.findById(thread._id)
.then((deletedThread) => {
assert(deletedThread === undefined)
.catch((err) => {

1) Remove Threads
removes a thread and its comments:
SyntaxError: Unexpected token { in JSON at position 79
at JSON.parse (<anonymous>)
at IncomingMessage.res.on (node_modules\superagent\lib\node\parsers\json.js:11:35)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

>> No.68709457


>> No.68709467

>i want this so badly
So you can start posting your tranny images?
Please no.
/pol/ are posting gore all over as some sort of misguided protest.

>> No.68709476

>my ascync callback hell is a nightmare to debug
millennial tech

>> No.68709488


>> No.68709493

404'ing the /api/thread/ call?
honestly, fucking print what's getting used

>> No.68709497
File: 30 KB, 908x756, 4channel.jpg [View same] [iqdb] [saucenao] [google] [report]

what am I in for?

>> No.68709508

Actual procedural programming hopefully.

>> No.68709515

Advanced C

>> No.68709521
File: 91 KB, 256x314, 2018-11-29-143731_256x314_scrot.png [View same] [iqdb] [saucenao] [google] [report]

a lesser version of pic related

>> No.68709530

Not a mochafag or anything. Just to be clear.
>SyntaxError: Unexpected token { in JSON at position 79
at JSON.parse (<anonymous>)

I picture the anonymous function referenced is the first 'then'. The json parse error is hopefully inside the request(app). Not that I know what either request or app would be in this context. You haven't provided that.
But if app is something you defined you should proof read it.

>> No.68709532

I actually started that but felt like it was a little opinionated and dropped it.
Once I do Advanced C Im gonna revisit that one.

>> No.68709545

>I picture the anonymous function referenced is the first 'then'.
*Lamba argument to the first 'then'

>> No.68709559

App is basically the file that provides routing and endpoints for the entire API. Weird thing is, if I test this manually (using postman) it goes through without a hitch.

>> No.68709573

So what's request?

>> No.68709600

Looking at this: https://stackoverflow.com/questions/33923/what-is-tail-recursion

The top answer has this:
function tailrecsum(x, running_total=0) {
if (x===0) {
return running_total;
} else {
return tailrecsum(x-1, running_total+x);

This is just what SICP calls an iterative process, right? So tail recursive is a recursive procedure definition that results in an iterative process. Am I getting this right?

>> No.68709606

Part of some NPM package that allows me to test REST API ""easily"". The request method just passes through the routing, server, etc. I've used it for the other 11 tests I have in the exact same manner and it had been working fine until now.

>> No.68709612
File: 1.60 MB, 850x1206, sample_6f905182c850b25d7947621b51b98319a23521a7.png [View same] [iqdb] [saucenao] [google] [report]

V1: Kasha!
V2 top: ... it's ok
V2 bottom: Eh eh?
V3: You liked me...?
V4: Y-yes
V5 top: I see~
V5 bottom: Blushing...!?

>> No.68709652
File: 24 KB, 284x283, 1499490884218.jpg [View same] [iqdb] [saucenao] [google] [report]

>when you write a program and it works

>> No.68709657

dumb frogposter

>> No.68709666

Got it somehow.
it('removes a thread and its comments', done => {
let savedThread
title: "beforeEachTestTitle"
.then((thread) => {
savedThread = thread
return request(app)
.delete("/api/thread/" + thread._id)
.then(() => {
return Thread.findById(savedThread._id)
.then((deletedThread) => {
assert(deletedThread === null)
.catch((err) => {

Had to remove .end(). For some reason it didn't think to specify that in the error.

>> No.68709792

I went to look at it and now I'm plagued by all kinds of hot (web) garbage.
Be warned.

>> No.68709813


>> No.68709823

What's advanced about the contents in that book?

>> No.68709852
File: 9 KB, 220x282, index.jpg [View same] [iqdb] [saucenao] [google] [report]

This is the only good book I've read

>> No.68709883

from the 65 pages ive read it introduces 3d arrays,type casting in detail,usage of dummy blocks,scope of variables ect.
something that is left as final notes in a beginner C book here is expanded on.

>> No.68709893
File: 141 KB, 1079x1280, 3529238327523.jpg [View same] [iqdb] [saucenao] [google] [report]

I am a pathetic webdev who is still in university for CS so i am fucking shit at programming, i know JS and C#, i want to learn a low-level language seeing as WASM Will maybe soon be usable, i was thinking about RUST because C++ seems a mess, is RUST a meme or actually as good as some make it sound?

>> No.68709904
File: 151 KB, 900x1200, 1542585152062.jpg [View same] [iqdb] [saucenao] [google] [report]

IDK why I keep wasting my time here
import std.stdio : writeln;
import std.array : replace;
import std.algorithm : permutations;
import std.utf : byChar;

auto combinations(string str)
return str.replace("a", "@").replace("e", "3").byChar().permutations();

void main()

>> No.68709905

on C/C++ (and c# and all other languages that has that) is there any perfomance different between using a regular if-else and using the ?: operator? or is it a compiler thing?

>> No.68709912

learn rust and ignore /g/

lots of /g/ already knows rust even if they pretend they don't. learn rust, libc, systems programming, networking programming, kernel api, etc

>> No.68709920

Learn C. Even if you plan to learn Rust or C++ eventually, learn C. You will understand how to do low level programming better if you start there.

>> No.68709939

what does C teach you about low level programming that rust doesn't?

>> No.68709942


>> No.68709973

from my understanding avoids a lot of typing and is useful in writing macros because you can for example compress 20 line code in a single line single macro.
is that fast or not? i could not tell since im a beginner.

>> No.68709987

To focus on the problem, not how to make it look nice.

>> No.68710031
File: 32 KB, 636x773, 1542680170320.jpg [View same] [iqdb] [saucenao] [google] [report]

Wtf why is it so damn big?
What did I miss? >>68709904

>> No.68710053

TIL C is a gateway drug to programming

>> No.68710079

Rust doesn't make it look nice at all. C teaches you to write unsafe code without warning you about it. Rust tells you when you're dumb and it's a better teaching language as well as practical language

>> No.68710081

C teaches you all the shit that can go wrong with pointers and memory corruption so when Rust stops you from doing it you can actually understand what it means instead of treating the solution as a magic compiler incantation

>> No.68710108

You won't know why the borrow checker is screaming at you until you know what happens without it.

>> No.68710118

The ?: operator evaluates to the value of the thing it chose
so you can do for example
printf("I have %d %s\n", numApples, (numApples == 1 ? "apple" : "apples") );

>> No.68710131

>you won't know why you don't want to get raped anally until you get raped anally

>> No.68710152

>printf("I have %d %.*s\n", numApples, 5 + !!(numApples > 1), "apples" );

>> No.68710198

>What are you working on, /g/?
Looking at the latest Project Euler question. It's tough!

>> No.68710217

post here, /g/ can solve it in no time

>> No.68710247

>What are you working on, /g/?
embedding python

>> No.68710268

Isn't a python too big to fit in?

>> No.68710290

atoms are mostly empty space
pythons are made out of atoms
thrfr. i got room to spare

>> No.68710358

don't even @ me you fucking losers
print('\n'.join([''.join(perm) for perm in __import__('itertools').permutations('yea'.translate({ord('a'): '@', ord('e'): '3'}))]))

>> No.68710384


>> No.68710401


the average /g/ user has never gone past the first page of problems, so I seriously doubt that (bit obviously don't spoil it if you can)

>> No.68710415
File: 250 KB, 1409x1600, 1533571632252.jpg [View same] [iqdb] [saucenao] [google] [report]

I'm new to programming. Why do you all use text editors instead of IDEs? How do you run your code and debug it using that?

Also, what should I be using? I'm learning C

>> No.68710424

/dpt/ equivalent of food analogies.
anal rape

>> No.68710427

Looks like garbage
Looks clean

>> No.68710451

everyone knows the fewer lines your code occupies the better it runs
every function should be "optimised" into a hideous overcomplicated one-liner with no comments

>> No.68710452

>download TinyC
>open notepad.exe
>write something in it
>save it as myprogram.c
Open cmd
type c:\tcc\tcc.exe -run c:\myprogram.c

thats all you will need for a long while.

>download microshit VS 50GB cancer
>enjoy setting it up for the next day
>dont take advantage from the advanced features you need because you are just beginner

you tell me pal

>> No.68710464

>microshit VS 50GB cancer
>implying thats a lot

Holy fuck at /g/tards still crying everyday about apps using 0.5gb of ram or something taking 50gb on their HHD

>> No.68710474
File: 105 KB, 1195x718, Untitled.png [View same] [iqdb] [saucenao] [google] [report]

>he has 50GB to spare

>> No.68710476
File: 15 KB, 460x342, 1340575217245.jpg [View same] [iqdb] [saucenao] [google] [report]

>How do you run your code and debug it using that?
Command line + aliases (Linux)

>Also, what should I be using?
Whatever feels most comfortable. You're a programmer, not a stenographer. The bottleneck is thinking speed, not typing speed.

>> No.68710480
File: 13 KB, 521x399, 1543463283203.png [View same] [iqdb] [saucenao] [google] [report]

>50 GB for a glorified text editor

>> No.68710483

How good are you at the following?

- Theoretical computer science
- Data structures and algorithms
- Theory of computation
- Information and coding theory
- Programming language theory
- Formal methods
- Computer systems
- Computer architecture and computer engineering
- Computer performance analysis
- Concurrent, parallel and distributed systems
- Computer networks
- Computer security and cryptography
- Databases
- Informatics practices
- Computer applications
- Computer graphics and visualization
- Human–computer interaction
- Scientific computing
- Artificial intelligence
- Software engineering
- Testing
- Programming paradigms
- System design

>> No.68710486

it is not too much, it is too much for what it does

>> No.68710487
File: 28 KB, 469x361, 1536383243350.jpg [View same] [iqdb] [saucenao] [google] [report]

How the fuck do l solve a quadratic equation using a square root property?

>> No.68710490


>> No.68710494
File: 23 KB, 370x347, 2018-11-29-162342_370x347_scrot.png [View same] [iqdb] [saucenao] [google] [report]

Forgot formatting

>> No.68710502

>he's coping because he's running a 7 year old CPU and only has 1.5 TB of storage

>> No.68710503
File: 18 KB, 587x490, my pc.png [View same] [iqdb] [saucenao] [google] [report]


>> No.68710507
File: 94 KB, 564x340, 687474703a2f2f692e696d6775722e636f6d2f61576e473033722e676966.gif [View same] [iqdb] [saucenao] [google] [report]


>> No.68710514

You guys bragging or crying

>> No.68710524

now do a REPL

>> No.68710539

Their point is that not everyone has the storage for a 50GB text editor.

>> No.68710544

Use whatever you feel comfy with
I personally like Codeblocks
When I'm on linux tho (college exams), ofc gedit and gcc on terminal

>> No.68710558

x^2+bx+b^2/4 - b^2/4 + c = 0
(x+b/2)^2 = b^2/4 - c


>> No.68710572
File: 57 KB, 728x677, Capture.png [View same] [iqdb] [saucenao] [google] [report]

Today I opened an assignment from my linux professor.
He wants us to teach ourselves bash scripting and perform three tasks.
I've gotten multiple texts from classmates on how 'bullshit' this is
I've only scripted a shitty VN in python but this doesn't seem that hard.
are they just whining? pic related

>> No.68710577

way too much work just to get a program to run once. What about when you're trying to get something annoying to work and you have to compile and run it dozens of times to test?

>> No.68710593

there's a common group of people who seem to completely give up and declare things "impossible" or "too hard" whenever asked to learn about something unfamiliar
these are the same people who complain when the questions on a math exam aren't just copy-pasted questions from the homework but with different numbers

>> No.68710596

Can someone explain how to make a differentiation/integration solver?
How do you even set that up?

>> No.68710603
File: 30 KB, 660x493, untitled_2.png [View same] [iqdb] [saucenao] [google] [report]


>> No.68710609

And they all magically get highest grades.
How odd.

>> No.68710613

Numerically or algebraically?

>> No.68710615
File: 250 KB, 1000x1000, 1524000325473.jpg [View same] [iqdb] [saucenao] [google] [report]

Yes. How the fuck do l do that? My fucking teacher always scares us into thinking that its more complicated than it actually is.

>> No.68710620

we live in a society

>> No.68710622

nah these people are retarded and probably butthurt it's not something they could have memorized word to word from a lecture

>> No.68710633

they get the highest grades because the american education system is shit and has started capitulating to them
they teach classes that are more about memorizing the right formulas and algorithms for the test than about learning how shit works

>> No.68710641


>> No.68710669

Same here in India, chief.
Fortunately, they're changing up things for next year.
There's gonna be open book exams.

>> No.68710674

>Helmholtz solver
This sounds interesting...

>> No.68710676

Create a data structure that is a symbolic representation of your expression then... differentiate it.

>> No.68710689

Sounds challenging

>> No.68710692
File: 59 KB, 646x576, sip_that_was_a_system.png [View same] [iqdb] [saucenao] [google] [report]

Take it from me.
I type this post on it,its comfy as fuck.

>> No.68710699

>>68710622 quoted by mistake

>> No.68710708

i bet this is like nim

>> No.68710710

just edit your post you boomer

>> No.68710716

>50 Gb of b̶o̶t̶ dotnet

>> No.68710733

i have to use vs sometimes bc i dont know how to link manually :(

>> No.68710744
File: 14 KB, 236x305, 1536139489132.jpg [View same] [iqdb] [saucenao] [google] [report]

Does one need ubuntu for developing snap packages?

>> No.68710753
File: 47 KB, 600x800, 1406273205217.jpg [View same] [iqdb] [saucenao] [google] [report]

>fix glaring design error while computing an error of 10 from expected output
>fixed code returns errors on more cases, now off several thousands from expected output
what in the goddamn
>crossed some wires
>uncross them
>still off by 10

>> No.68710768

Its like saying you don't know how to tie your shoelaces.

>> No.68710778

lol plenty of people dont know how to tie shoelaces

>> No.68710787
File: 87 KB, 236x305, Untitled.png [View same] [iqdb] [saucenao] [google] [report]


>> No.68710792

That doesnt make it ok.

>> No.68710992

Should i switch from CS to CE

>> No.68710994

I wanted to start a project using https://github.com/jtdaugherty/brick, but now that AoC is around the corner I don't feel like it anymore.
I think I'll go for Idris because of muh type driven development, otherwise it'll be Haskell.

>> No.68711001

[Akai Yoru] Otokonoko to Date no Renchuu (Tamaharu)
[紅威ヨル] 男の娘とデートの練チュー (たまはる)

>> No.68711039

The differences?

>> No.68711043


>> No.68711052

do you have digital electronics and stuff in CS?

>> No.68711068

I believe the only difference is having the analog and digital circuits portion in CE.
I think CS does not have digital electronics stuff like mux, demux and analog circuits and all that stuff.

>> No.68711124

CE here, it depends on the school, but most places I've seen it's more like EE with programming than CS with electronics. That's how it was for me anyway. I have a job in firmware now if you're curious about what kind of work you can get out of it.

>> No.68711397

psssh, nothin personnel kid

int sockMerchant(int n, vector<int> ar) {
unordered_map<int, int> m;
return std::accumulate(ar.begin(), ar.end(), 0, [&m](int a, int b) {return !(++m[b] % 2) ? a + 1 : a;});

>> No.68711435

>copying the vector

>> No.68711500

Redpill me on Golang

>> No.68711522

x40 times FFI cost

>> No.68711687
File: 78 KB, 1105x1053, 1538213278310.png [View same] [iqdb] [saucenao] [google] [report]

based frogposter
i hope one day every post will have a picture of a frog attached to it

>> No.68711700
File: 77 KB, 1300x918, file.jpg [View same] [iqdb] [saucenao] [google] [report]

Exception has occurred: IndexError
list index out of range

HObstacles = [item for item in obstacles if item[0] == r_q]

>> No.68711702
File: 33 KB, 637x921, 349.jpg [View same] [iqdb] [saucenao] [google] [report]

>delivery by end of day
>already noon and no sign of it

>> No.68711715

Write new operating system for RISC

>> No.68711728

Switch to EE my dude

>> No.68711733


>> No.68711758

it was malformed input because I'm not fucking paying attention

the code takes every item in obstacles if the first element of item equals to a variable
in this case every item is a list of int of length 2

>> No.68711777

Holy shit I was wrong
This isn't bullshit but I probably should have given my self more than 10 hours to learn a new language
Why the fuck can't everything be as retard friendly as python?

>> No.68711787

OOPsies please leave.

>> No.68711797
File: 190 KB, 1024x768, 1518799450077.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.68711837

why does no one use c++ exceptions?

>> No.68711859

Exceptions are a mistake

>> No.68711873

It's not difficult, the trick is the fact that you're often working with table-formatted strings, which sucks donkey balls compared to any struct-based approach.

>> No.68711878

based sminem poster

>> No.68711896

OOPsies please stop using bad programming languages.

>> No.68711902

Exceptions are a form of state.
Adding state to your code will make it difficult to debug and will introduce control flow (exceptions are control flow whether you use them that way or not) which makes it difficult to reason about your code.
Ideally, any code you write will be purely functional with all of the side-effect stuff safely cordoned off where they can do less harm.
This does not mean "no OOP", it just means arguably simpler.

>> No.68711925
File: 397 KB, 400x418, 1541335119989.gif [View same] [iqdb] [saucenao] [google] [report]

Should I do AoC in Rust or Nim? I currently know neither of those languages, so I'd have a day to get profecient enough in them.
Keep in mind that I do know C and Python.

>> No.68711931

Good code means no OOP.

>> No.68711939

Idris. Haskell if you're feeling dirty.

>> No.68711948
File: 29 KB, 320x284, weird_anime.jpg [View same] [iqdb] [saucenao] [google] [report]

>it's a funcitonal programmer believes he is the saving grace of the world episode

>> No.68711964

I was considering Haskell and Guile as well, but I don't think I'll be able to learn them this fast. I also have exams till two weeks in December, so I wouldn't be able to give it a lot of time till then.

>> No.68711988

>it's a dysfunctional programmer gets ideas above his station episode

>> No.68712012
File: 210 KB, 473x625, RustProgrammingLanguage_cover_0.png [View same] [iqdb] [saucenao] [google] [report]

I was reading a few bindings for different languages and when I read the rust one I started thinking about transexuals
Thanks for ruining my mind faggots
I will say something nice about it that it reminded me of C a lot more than other languages that are supposed to be C clones.

>> No.68712036

Haskell is easier to learn than most mainstream languages. Fewer surprises. No getter/setter/factory/pattern enterprise bullshit.

>> No.68712044

So what you're saying is that /dpt/ made you unable to learn programming? Quelle surprise.

>> No.68712055
File: 81 KB, 842x792, 1543378682807.png [View same] [iqdb] [saucenao] [google] [report]

>he locks himself into one single paradigm

>> No.68712063

> /dpt/ made you unable to learn programming
What? No, now I just associate rust with trannies.

>> No.68712065

Just use Go by Google!

>> No.68712085

>I currently know neither of those languages
you're going to have a fucking hard time with Rust. It's not a language you casually pick up.

>> No.68712086

>he still thinks shitty paradigms have anything to offer
>he still thinks FP advocates don't also use other good paradigms where appropriate

>> No.68712089
File: 162 KB, 1400x785, 1514292934158.jpg [View same] [iqdb] [saucenao] [google] [report]

>she relies on paradigms and doesn't code freely

>> No.68712094

>no one uses c++ exceptions
I beg your pardon?

>> No.68712096

That's untrue. I found Rust fairly easy to learn.

>> No.68712108



>> No.68712109

donkey balls is right. I've figured this much but formatting eludes me atm
for i in $(cat /etc/passwd | cut -d: -f1); do
#for i in $(cat /etc/passwd | awk -f:'$3 > 999'); do
echo -n $i ": "
grep $i /etc/group | cut -d: -f1 |tr "\n" ","

but that still outputs way more than he wants and without the formatting he wants

>> No.68712111

Ah yes, the ball of mud approach.

>> No.68712126

pure functions can be provably correct and require less unit tests.
Debugging stateful functions is painful. I just had to jump stack traces because the stack trace you got is actually a polling operation on a remote API with shitty error messages
and then trying to reproduce the state was a nightmare in and of itself

>> No.68712139

there really is no downside to FP. Especially if you can do in in an imperative lang that strongly supports FP, so you can have performance too.

>> No.68712143

So basically having HKTs and/or DTs is a necessary but not sufficient condition for being a good programming language.

>> No.68712155

What's usually used to make SQL databases?

>> No.68712156

Why did we ever stop using lisp, bros

>> No.68712157

But if we move to FP, what will all the programmers who refuse to learn it do?

>> No.68712159

c++ exceptions are unfashionable

>> No.68712160


>> No.68712168

A SQL implementation

>> No.68712173


>> No.68712177

find a new job.

>> No.68712180

something like that

>> No.68712185

C++ exceptions are intolerable. Need to throw in a destructor? Well, shit. Need to throw in a constructor? Well, shit.

>> No.68712188

He means pi types. Note that both HKT and DTs are just workarounds for the industry tested OOP.

>> No.68712194

paradigms are just the design pattern of programming languages.
they emerge naturally and merely provide a common description of a pattern and are primarily useful for communication purposes.
design patterns are purposefully poorly defined and cannot be relied upon to prove any facts about code using them.

>> No.68712197

Dependent types.

>> No.68712203

this is bait

>> No.68712209

Shit, really?

>> No.68712215

Truth hurts.
Functional programming is a fashion statement.

>> No.68712230

>truth hurts
alas i'm unharmed

>> No.68712231

>Functional programming is a fashion statement.
how long is a fashion statement before it's just common fashion?
Are all these companies converting their entire code-bases over just to be trendy?

>> No.68712232

I want sigma types too, damnit!

>> No.68712242

So this is the new cover story for OOPsie ineptitude.

>> No.68712243

>Need to throw in a destructor?
The only instance in which cleanup can fail that I can think of is file handling. That's fairly rare, and not the usual use case for destructors.
>Need to throw in a constructor.
But that's practically the main reason exceptions exist. What's wrong with this particularly?

>> No.68712262

Don't delude yourself into thinking companies using fashion programming for their toy sub-project will replace their underlying codebase where real work takes place.

>> No.68712263
File: 71 KB, 170x189, 1535018723560.png [View same] [iqdb] [saucenao] [google] [report]

in Java I can do

public abstract class Foo{
public abstract void bar();

new Foo(){
public void bar(){};

how do I do that in c#?

>> No.68712269


>> No.68712278

all of those codebases are maintained by boomers nearing retirement with no replacement

>> No.68712283

The abstract visitor factory adapter instance pattern.

>> No.68712295
File: 518 KB, 595x682, 1542313251097.png [View same] [iqdb] [saucenao] [google] [report]

dont functor with me, kiddo.

>> No.68712296

oh boy, another episode of "Move That Goalpost!

>> No.68712299

>almost 2019
>still using terminals
What the fuck is wrong with you?

>> No.68712300

Based and Redpilled.

>> No.68712325

C# doesn't have anonymous classes. You should use delegates instead, they cover the typical use case.

>> No.68712327
File: 170 KB, 500x500, ponk.png [View same] [iqdb] [saucenao] [google] [report]

Every programmer before me is WRONG
Your language an OS are SUBOPTIMAL and RUBBISH

>> No.68712328

whats wrong? university didn't teach you how to sudo apt-get?

>> No.68712339

Guys, is there a C compiler + debugger for Atom?

I don't want to use code::blocks. I think it's ugly.

>> No.68712343

>tfw unironically want to move to Dragonfly BSD
Too bad it'd be like using GNUL a decade ago.

>> No.68712344

I use Synaptic Package Manager

>> No.68712345
File: 472 KB, 480x312, 1541032473055.gif [View same] [iqdb] [saucenao] [google] [report]

>C# doesn't have anonymous classes.
shit fuck ass

>> No.68712350
File: 59 KB, 350x350, 1537525120709.jpg [View same] [iqdb] [saucenao] [google] [report]

CIA nigger cattle best repent before I make you repent

>> No.68712371

I already know some Haskell, but it's kind difficult to reason in it if you're not used to it. At least that's how it feels like.

I realize that, but I don't think you would need to know the entire language spec to participate in a coding competition. Just the basic syntax, and how to create trees and shit.

>> No.68712375
File: 610 KB, 1291x3600, 1534935983694.jpg [View same] [iqdb] [saucenao] [google] [report]

>links a handful of numale startups
As opposed to the countless large and relevant businesses around the world?
Come back when even one of your fashion programming languages outweighs OOP in a single company on forbes top 10 list. I won't wait.

>> No.68712376

but why. 1 command line is literally faster than opening a GUI

>> No.68712378

Categories are simply objects and methods (also called arrows). Haskell, being based on category theory, is therefore simply OOP. Similarly FP is also simply OOP. This is borne out by the fact that functions and ADTs are simply objects.

>> No.68712402

Please go on, I'm sure you have a lot of interesting things to say.

>> No.68712409

It might be difficult to use Haskell if you expect it to behave like, say, Python. It's a different beast. Clear out any preconceived notions you have about programming.

>> No.68712428

>a million people use Java so it must be good!

>> No.68712461

what makes haskell better than java for making "A distributed ledger for secure multiparty workflows in financial markets"
honest question btw

>> No.68712462

>and how to create trees and shit.
laughs in Rc<RefCel<Box<T>>>

Yeah it does. Better performance, better readability, better documented, time and battle tested.

>> No.68712466

Rust has a steep initial learning curve because of the borrow checker.

>> No.68712488

>all these buzzword for a fucking ledger book software
As I said, functional programming is nothing more than a fashion statement.
Purity alone makes it impractical.

>> No.68712493
File: 37 KB, 535x577, wosad.jpg [View same] [iqdb] [saucenao] [google] [report]

Terry is unironically my hero
His moments of lucidity when discussing TempleOS and the problems of modern operating systems and their consumers were truly inspiring

I miss him, bros

>> No.68712500

>implying the best thing to do isn't imperative executable code and functional specification/proof code

>> No.68712507

>implying there is an objective best solution for everything, and you shouldn't use different tools for different tasks

>> No.68712512

In a situation where security is a must you would use a language with dependent typing system like F* or Idris to build a provably correct communication protocol
Functional languages (like Haskell) are also provably easier to reason about when it comes to concurrency and deadlocking.

Other than that, languages similar to Java are preferred simply because more people know how to use them, resulting in getting a working product out of the door faster.

>> No.68712519

>Yeah it does. Better performance, better readability, better documented, time and battle tested.
No, it really doesn't. A house built on a shitty foundation will always have a shitty foundation no matter how much effort you put into the wallpaper and how much you avoid stepping on the part of the floor that sinks down.

>> No.68712530

That's why we call him King Terry.

>> No.68712534

>implying OOP is ever the best solution

>> No.68712541

>his turbo-autistic nonsensical rant inspired me
to do what exactly?

>> No.68712557

To ignore the CIA niggers and blaze my own trail

>> No.68712564

The whole premise of fashion programming is working around the restrictions that come with purity and the lack of OOP.

>> No.68712576

>>links a handful of numale startups
no idea JP morgan was a numale startup.

>> No.68712589

what does this do in C?
why the curly braces?
int n = {0};

>> No.68712595

oh no JP Morgan used FP for a couple of toy sub projects while their whole system is a mixture of procedural and OOP!
How can I ever recover!

>> No.68712614

how do i get gud

>> No.68712620

They're a good thing.

>> No.68712621

If you have to keep track of companies using your language to show it's relevant, you already lost.

Ever seen C/C++/Java fags list these?

>> No.68712634

>They're a good thing.
No thanks, keep making your I/O less fizzbuzz while adults are doing real jobs.

>> No.68712635

Where is semigroupoids for Java? Where is mtl for C#?

>> No.68712643

Suck hard
Write lots of code

>> No.68712645

why do you worship the enterprise dick so hard lad?

>> No.68712646

>I like my code to be difficult to reason about

>> No.68712660

>shits out another numale startup

>> No.68712661

How do you guys find projects to work on? I am having a hard time finding a niche or something, i guess what i was craving for was collaboration in the end but it's worth giving it a try again.

>> No.68712662

doesn't do anything different than int n = 0;
it'd be useful if n were a struct instead of an int

>> No.68712670

>I like to do pointless allocations because muh purity
>puts("fp is for cucks"); is hard to reason about!

>> No.68712677
File: 696 KB, 724x986, nope.png [View same] [iqdb] [saucenao] [google] [report]

try again m8

>> No.68712693

Just bee yourself

Personally I pretend to be a girl, so thirsty white knights give me good positions

>> No.68712695

fetchScores :: (ScoreDB m, Traversable t) => t Player -> m (t Score)

Just think about how much more that tells you than

List<Score> fetchScores(List<Player> players, ScoreDB scoreDB)

>> No.68712699

>Facebook's sigma is a toy project

>> No.68712707

Next: >>68712690

>> No.68712712

Don't you get it? FP implies toy project. Therefore FP can never win!

>> No.68712731

Facebook is almost entirely C++, yes I'm talking about their private repo. Anything sitting on top of that is trivial.

>> No.68712733

granted in a readable language, it's just
Score[] fetchScores (Player[] players, ScoreDB score)

>> No.68712735
File: 530 KB, 1280x1815, 156.jpg [View same] [iqdb] [saucenao] [google] [report]

oh boy

>> No.68712744

>they started with C++
>now with the benefit of experience they're moving to FP
Do you imagine that this helps your anti-FP crusade?

>> No.68712760

Everything goes through Sigma.
That's far from trivial

>> No.68712766

>facebook is moving to FP

>> No.68712767

It doesn't tell you very much more, but it lets you do a lot more.

>> No.68712785

You just admitted it a few posts ago.

>> No.68712825

So, if I am storing an array of structs in a file and I will be printing these items, copying them into a tmp file and vice versa, should I just store them in memory so manipulation is easy or keep them in storage to reduce memory usage?

>> No.68712829

W-what? How's this gonna help me find programming friends?

>> No.68712928


It isn't. Anon is fucking with you because he wants to literally fuck you.

>> No.68712985 [DELETED] 

10486 >>68710487 >>68710490 >>68710494 >>68710502 >>68710503 >>68710507 >>68710514 >>68710524 >>68710539 >>68710544 >>68710558 >>68710572 >>68710577 >>68710593 >>68710596 >>68710603 >>68710609 >>68710613 >>68710615 >>68710620 >>68710622 >>68710633 >>68710641 >>68710669 >>68710674 >>68710676 >>68710689 >>68710692 >>68710699 >>68710708 >>68710710 >>68710716 >>68710733 >>68710744 >>68710753 >>68710768 >>68710778 >>68710787 >>68710792 >>68710992 >>68710994 >>68711001 >>68711039 >>68711043 >>68711052 >>68711068 >>68711124 >>68711397 >>68711435 >>68711500 >>68711522 >>68711687 >>68711700 >>68711702 >>68711715 >>68711728 >>68711733 >>68711758 >>68711777 >>68711787 >>68711797 >>68711837 >>68711859 >>68711873 >>68711878 >>68711896 >>68711902 >>68711925 >>68711931 >>68711939 >>68711948 >>68711964 >>68711988 >>68712012 >>68712036 >>68712044 >>68712055 >>68712063 >>68712065 >>68712085 >>68712086 >>68712089 >>68712094 >>68712096 >>68712108 >>68712109 >>68712111 >>68712126 >>68712139 >>68712143 >>68712155 >>68712156 >>68712157 >>68712159 >>68712160 >>68712168 >>68712173 >>68712177 >>68712180 >>68712185 >>68712188 >>68712194 >>68712197 >>68712203 >>68712209 >>68712215 >>68712230 >>68712231 >>68712232 >>68712242 >>68712243 >>68712262 >>68712263 >>68712269 >>68712278 >>68712283 >>68712295 >>68712296 >>68712299 >>68712300 >>68712325 >>68712327 >>68712328 >>68712339 >>68712343 >>68712344 >>68712345 >>68712350 >>68712371 >>68712375 >>68712376 >>68712378 >>68712402 >>68712409 >>68712428 >>68712461 >>68712462 >>68712466 >>68712488 >>68712493 >>68712500 >>68712507 >>68712512 >>68712519 >>68712530 >>68712534 >>68712541 >>68712557 >>68712564 >>68712576 >>68712589 >>68712595 >>68712614 >>68712620 >>68712621 >>68712634 >>68712635 >>68712643 >>68712645 >>68712646 >>68712660 >>68712661 >>68712662 >>68712670 >>68712677 >>68712693 >>68712695 >>68712699 >>68712707 >>68712712 >>68712731 >>68712733 >>68712735 >>68712744 >>68712760 >>68712766 >>68712767 >>68712785 >>68712825 >>68712829 >>68712928

>> No.68713010


Is there any reason why you felt like quoting about 40% of the thread?

>> No.68713033

>1/22 test cases failed :(
This is the most flimsy piece of shit code I've ever made and it's making me foam up at the mouth with how fucking stupid the errors seem to be
and now it looks like there's some inherently wrong calculation that throws this fucker off by TWENTY FOUR while it's all fine and dandy with the other 21 cases

>> No.68713036


>> No.68713069


>> No.68713109


Walk yourself through the code, line by line, on the test case that failed.

>> No.68713161

eh fuck it, I'm going for a walk
result should be 60, is 38
Did several times, the math part of the code is working as intended. There's some input misinterpretation somewhere in there and I can't find out why or what is causing it.
problem is https://www.hackerrank.com/challenges/queens-attack-2/problem if you're wondering

Name (leave empty)
Comment (leave empty)
Password [?]Password used for file deletion.