/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

youtube.com/watch?v=Ee3EtYb8d1o
cemerick.com/2009/03/24/why-mit-now-uses-python-instead-of-scheme-for-its-undergraduate-cs-program/
cs.cornell.edu/courses/cs3110/2009sp/hw/ps3/ps3.html
cs.cmu.edu/~ab/Desktop/15-211 Archive/res00107/LZW.pdf
github.com/krishpop/LZW/blob/master/trie.c
buildyourownlisp.com/
hokstad.com/compiler
people.eecs.berkeley.edu/~bh/sicp.html
htdp.org/
edx.org/xseries/systematic-program-design-0
cs.hmc.edu/csforall/
edx.org/course/cs-all-introduction-computer-science-harveymuddx-cs005x
better-dpt-roll.github.io/
en.wikipedia.org/wiki/Algorithms_+_Data_Structures_=_Programs
twitter.com/SFWRedditImages

is programming the most pathetic occupation? certainly seems so given the amount of weaboo autists that choose to pursue it

nth for zig

a lot of programmers are pathetic, stupid low testosterone faggots but if you're a really good programmer and you're working on difficult things it can be respectable imo

Notice how all the social rejects end up becoming programmers in college because they have nothing else going for them.
I don't really blame them, it's a comfy gig if you know what business environments to avoid.

post code example

>lol its simply a file where I define methods of classes declared in declarations.hpp
>I don't care enough to make a new file for each class or method I define, I have a mouse that is capable of scrolling.

Ok, enjoy compiling the entire program every time you make a tiny change.

Rate my language.

xがありますよ!

factorialという手順です。
nとfがあります。
nは 0です。
fは 1です。
n != x ながら、
nは n + 1 ですね。
fは f * n です!

xは16ですよ。
factorialしてください。


It's basically just PL/0 with some different keywords.

Here's the grammar:
factor = ident | number | "(" expression ")".

term = factor {("*"|"/") factor}.

expression = ["+"|"-"] term {("+"|"-") term}.

condition = expression ("="|""|"="|"!=") expression.

is = "だ"|"です".

exitsts = "がある"|"があります".

end = ["よ"|"ね"], ("。"|"!").

statement = [ ident expression is | ident "して", ["ください。" | 下さい。"]
| statement {"。" statement }
| condition "の時、" statement
| condition "ながら、" statement ].

block = [ ident "は" number is {"、" ident "は" number is} "。"]
[ ident {"と" ident} exists end]
[ ident "という手順" is "。" block "。"} statement.

program = block "。".

ないわ。

Looks nice. I'll see if I can build it and make something tonight when I get home.

What's the correct way to implement periodic updates in a video game server? Is it just polling periodically? Because I heard select() was slow.

I've got a "chat" server implemented, plus a client, and it just polls for accept() on a non blocking socket on one thread and polls for recv()s on another. But that seems CPU intensive, even with an FPS limit.

I want to make a program that converts my custom syntax into a c file
I, of course, want my custom syntax to translate as much as close to the desired c

so instead of
#include

void kys(void) {
printw("kys yourself\n");
return;
}

int main() {
initscr(); cbreak(); kys();
refresh(); endwin();
return 0;
}


i'd have
need ncurses

kys = printw "kys yourself\n"
main = {
initscr; cbreak; kys;
refresh; endwin;
return 0;
}


of course, this is just the concept, obviously, it'd be more sophisticated
but i've never done complicated parsing
it this something doable?

I was thinking that maybe haskell was a good choice for doing this

any thoughts?

Thank you for anime picture.

Wasn't a similar question as yours asked in the prev thread? They recommended checking flex and bison, haven't really been into parsers so can't help much.

how much hotter would c be if
char duck(char *s, char *j) {
blah(); blah(); quack();
return somechar();
}

could be
duck :: *s -> *j -> char
duck = {
blah; blah; quack;
somechar;
}

Is project euler worth doing if you aren't that good at math? Most of my solutions turn out to be shit when I find people who know what they're doing with math.

tf are you doing
duck :: *char -> *char -> char

makes more sense

duck :: pchar -> pchar -> char

function :: pint -> plong -> ppchar

Gonna be honest, the original C syntax is easier to read.

>muh data structures
>muh algorithms

thats cause you've never learned haskell
f :: a -> b -> c
means to take an a, a b and return c
but since c has no polymorphic types
would make more sense

What's a good C++ IDE? I've been using Visual studio but it's slow and bloated.
I've tried clion, lt's amazing but isn't free.

VS is fine

Should I read SICP or take a Haskell course on EDX?

Finally trying a test-driven development cycle. Specifically, it's for a parser for my ongoing wikitable editor project.

Right now the parser can understand a simple table in mediawiki markup, as long as it doesn't have any special formatting like spans or headers. Hopefully I can get that stuff working tomorrow, although I might be stuck in meetings all day.

I can't get JUnit to work at the office (apparently it needs to run across the network, and whatever port it needs isn't open? I don't know.) so I wrote my own basic testing framework. I'm pretty pleased with it.

g++ on command line with vim and syntax highlighting or codeblocks

Is Go basically a scripting language with C like syntax and good concurrency?

On Windows I use MinGW with Vim or Microsoft's compiler from the command line with Vim.

This video has a pretty good tutorial on how to set up a command line dev environment on WIndows:
youtube.com/watch?v=Ee3EtYb8d1o

>tfw no Sup Forums user mentor to teach me how to program

if you cant teach yourself then you are weak minded, i used to be too, until i installed gentoo

char(*duck)(pchar,pchar)
duck :: char -> pchar -> pchar

There are literally 1000000 sites out there to teach you how to do every fucking thing related to programming, systems administration, etc.

The one thing programmers/sysadmins like to do the most is work on meta shit.

Bash is what happens when you let a NIGGER design a language.
Seriously fuck this piece of shit.

Learn rust instead

wow
racist much?
did you not read the dpt code of conduct

Read SICP.

Fuck off and kill yourself.

Haskell
Even the creators of SICP said it's worthless

I thought this would be a big drawback when working with compiled langauges, but coming from NodeJS/Python land I find being forced to compile when you make changes is helpful, at least for me.

It encourages me to code intelligently instead of just trying to stick in some little fix so it works and reloading the page/app. Dunno, maybe that's just a side effect of not writing in JS/Python. :p

you again?

Go back to Sup Forums with the other animals.

Hello

it me

For real though yeah it's me; my roomate's a Sup Forums guy and I spent like 10 minutes watching him shitpost /fit/ or some shit and it looked fun so here I am.

>my roommate's a Sup Forums guy
punch him for letting the secret out
it's his fault there are so many newfags
>/fit/
he's probably a newfag too

>/fit/

get out

who /learning c++/ here?

need ncurses, string, stdio

kys void
kys: printw "kys yourself\n"

pow int base, int n :> int // function prototype
pow a b: for (int p 1, j 0) (j void
getline xs s: for (int i 0, c) (i

already know it

I fell for the meme first but now I only use C.

sepples sucks because of boost

any better way to do pic related?
> inb4 php a shit

>Even the creators of SICP said it's worthless

proof

>verificaSeFormularioEValido
This is some spanish bullshit

anyway,

>if (condition) return true; else return false;
just return the condition

return ($msgErroNome === "") && ($msgErroEmail === "") ...

otherwise, put all 5 into an array, then iterate over it so you aren't repeating the && .. === ""

cemerick.com/2009/03/24/why-mit-now-uses-python-instead-of-scheme-for-its-undergraduate-cs-program/

thanks user
> pic related

I'm working on a LZW compression project and I have to use a trie. Although I don't think I get how tries work with LZW, tries don't seem to generally have getIndex functions they only seem to have searches.

Is there a special LZW trie your supposed to use or am I just retarded?

cs.cornell.edu/courses/cs3110/2009sp/hw/ps3/ps3.html
cs.cmu.edu/~ab/Desktop/15-211 Archive/res00107/LZW.pdf
github.com/krishpop/LZW/blob/master/trie.c

dude, you're fucked.

Is C++ comfy for functional programming?

No

>Thing sucks because of optional thing that isn't even bundled with thing by default

No.

Only use things like lambdas together with the standard library.

Do you go to Waikato University by chance?
This is one of the projects that I'm supposed to be working on too.

Sure do, what a small world.

...

>cemerick.com/2009/03/24/why-mit-now-uses-python-instead-of-scheme-for-its-undergraduate-cs-program/

>As a short addendum, while I had Prof. Sussman’s ear, I asked him whether he thought that the shift in the nature of a typical programmer’s world minimizes the relevancy of the themes and principles embodied in scheme. His response was an emphatic ‘no’

He isn't saying Scheme SICP is worthless there

We already knew Scheme was worthless, what he's saying in the article is that SICP is worthless

w-why?? ;_;

why not?

No he's not

hivemind

try an actual functional language and you'll know the difference
not having built in currying, for instance

Calm down matey, it was just a passing comment. I'm not going to bring up a discussion between us in this thread.
I'm not even that interested in meeting another user in real life.

Wow, user, are you gonna take that from ?
He goes to the same Uni as you and he says he never wants to see your face in the first place, let alone again!

well i read the wiki article on it...so basically all the meme languages are for functional programming while c++ does the real dirty work

What the fuck are you smoking?

I agree, I just come here for some handy tips

are you retarded?

multi-paradigm > functional

name a single multi-paradigm language that's ACTUALLY multi-paradigm and not just 3-of-all-trades

FP allows for easy embedding of other paradigms, but isn't itself easily embedded

How can I look at the java api with my smartphone?

Could anyone give me a good guide for Boost Asio? I want to write multithreaded server with asio sockets and boost threads.

Someone recommend me a book on writting your own language, preferably using LLVM.

ayy lmao

/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA)

buildyourownlisp.com/
www.stephendiehl.com/llvm/
hokstad.com/compiler

people.eecs.berkeley.edu/~bh/sicp.html

Take

htdp.org/
edx.org/xseries/systematic-program-design-0

or

cs.hmc.edu/csforall/
edx.org/course/cs-all-introduction-computer-science-harveymuddx-cs005x

data structures + algorithms = program

ever considered writing a book?

Why haven't you killed yourself yet, you attention whore?

Sometimes I wonder if these eyes are valid bar-coes...

(defun duck (s j)
(declare (type (pointer standard-char) s)
(type (pointer standard-char) j)
(blah) (blah) (quack)
(the standard-char (somechar)))
(((:^)))

>data structures + algorithms = program
program = logic + control
git gud

>buildyourownlisp.com/
Looks great thanks user.

He said language not lisp

holy hell

better-dpt-roll.github.io/

>attention whore
>anonymous

en.wikipedia.org/wiki/Algorithms_+_Data_Structures_=_Programs

And thank you for your reply.

please, don't bully.

How is logic different from control?

>michael
Poltard get out.

Rate my calculator

@echo off
title Calculator
echo Type "exit" to exit.
echo.

:start
set /p input=
if %input% == exit exit
set /a num=%input%
echo %num%
echo.
goto start

0/10

SICP-grade/10

>currying
Total meme.

func = map (+1)

auto func (auto list) {
return map([](auto x){ return x + 1; }, list);
}

func = map (+1)
func = map (\x -> x+1)
wew what an improvement