/dpt/ - Daily Programming Thread

Last thread: What are you working on, Jow Forums?

Attached: 0qD5Weh.png (347x347, 353K)

Great image, OP.

Attached: anime girl faggot.jpg (330x413, 20K)

Attached: 1561273444286.jpg (1156x1456, 254K)

Better than the typical /dpt/ animu bullshit.

how's the progress coming lads?

Attached: [Coalgirls]_Yuru_Yuri_03_(1280x720_Blu-Ray_FLAC)_[B25D1CAF].mkv_snapshot_04.11_[2018.07.11_06.39.05] (1280x720, 1.33M)

Ftrace trace-cmd segfaults every time I use it

If someone could help me with this I would be very grateful.

>average file size is between 2000 and 7000 lines
>enums are passed as int parameters
>objects are never passed by value, always converted to an array of strings, then parsing them
>these arrays can be 50 or more elements long
>endless switch cases, one of them went up to 100 (they were all ints by the way)
>responsibilities are not separated, starting processes, displaying the results, generating a page to print, database management all done by the same thing
>nothing is commentated
You'd think this was some low-level C or Fortran program, but no, it's in fucking C# and it's running on Windows 10
I became a .net dev to get away from this

REAL THREAD

REAL THREAD

Attached: 1559528162298.jpg (1000x1220, 175K)

I would have helped you out, but my girlfriend is korean

Real new thread:

Attached: 791b4f96eb163cfda6428c8ce42d73a2.jpg (591x600, 80K)

No problem user.

Stop shilling your stupid thread fag.

Attached: 1559676966737.jpg (957x621, 90K)

based Jow Forums poster

>two replies within 20 seconds
>must be one guy using multiple IPs hurr

What are the good projects to practice LISP?

Should I learn Haskell?

>doing a lot of work line of code-wise but it's all boilerplate slightly altered for different cases
Is this what it's like to work with languages like C or should I rethink my approach

Programming without generics is like that.

Interesting. Let's see which thread win.

Attached: 1416008881257.jpg (1360x1336, 681K)

This thread is older, jannies should delete that impostor thread.

this thread is shit, it belongs on reddit
fuck off dumb frogposter

Can i get a help with yacc/lex? I need to parse 2 Teams names and then goal results in format 5:2, then print which Team won. Problem is if first number > second number, then i want to print first word ($1) but it prints whole sentence instead. Why?

Well ok, i fixed it somehow with adding whitespace before regexp and after it, it works but fail if i dont write whitespace before name of first team. Is there more elegant solution?
lex code
%{
#include
#include "y.tab.h"
%}
%%
[0-9]+ yylval=atoi(yytext); return NUMBER;
\b((e[A-Z][a-z]+)|([A-Z][a-z]+[A-Z][a-z]+))\b yylval=yytext; return TEAM;
vs return VS;
: return COLON;

\n /* ignore end of line */;

%%


yacc code
%{
#include
#include

int yywrap() { return 1;}
void yyerror(const char *str) { fprintf(stderr, "error %s\n",str); }
main() { yyparse(); }

%}
%token NUMBER COLON VS TEAM
%%
commands: /* empty */
| commands command
;

command:
points
;

points:
TEAM VS TEAM NUMBER COLON NUMBER
{
if($4>=$6) printf("Team %s with score %d : %d", $1, $4,$6);
else printf("Team %s won with score %d : %d", $3, $4,$6);
}
;
%%

>yacc/lex

People still use this disgusting buggy ancient shit? Fuck me. I should write an Earley parser.

Asynchronous webserver.
Macros for creating serializable data models.
Parsers for JSON and YAML.

Get to it, fellow LISPer.